Locale DateTime format not used in NDatePicker (input inside the dropdown) + update fr-FR locale date separator
See original GitHub issueTuSimple/naive-ui version (版本)
2.21.5
Vue version (Vue 版本)
3.2.24
Browser and its version (浏览器及其版本)
N/A
System and its version (系统及其版本)
N/A
Node version (Node 版本)
Reappearance link (重现链接)
https://www.naiveui.com/en-US/os-theme/components/date-picker
Reappearance steps (重现步骤)
Choose fr-FR locale, open NDatePicker dropdown, then pick a date: the date input inside the dropdown is still using en-US locale.
Expected results (期望的结果)
Locale DateTime format used in NDatePicker (input inside the dropdown)
Actual results (实际的结果)
That input is still using the default en-US locale
Remarks (补充说明)
Oups! I just notice that, in my previous issue #1751, I miss the date separator (/
instead of -
) in my translation, it should be:
{
Time: {
dateFormat: "dd/MM/yyyy",
dateTimeFormat: "dd/MM/yyyy HH:mm:ss"
}
DatePicker: {
monthTypeFormat: "MM/yyyy",
dateFormat: "dd/MM/yyyy",
dateTimeFormat: "dd/MM/yyyy HH:mm:ss"
}
}
Really sorry, my bad 😞
Also, I guess the input field inside NDatePicker
should probably respect the locale format too:
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Locale DateTime format not used in NDatePicker (input ...
Choose fr-FR locale, open NDatePicker dropdown, then pick a date: the date input inside the dropdown is still using en-US locale. Expected ...
Read more >Get Locale Short Date Format using javascript
This is not a solution to obtaining the format string, but you can use ((new Intl.DateTimeFormat()).format(new Date()); to get a formatted date string....
Read more ><input type="datetime-local"> - HTML - MDN Web Docs
The format of the date and time value used by this input type is described in Local date and time strings in Date...
Read more >DatePicker | NG-ZORRO - Ant Design
Angular DatePicker Component, To select or input a date.By clicking the input box, you can select a date from a popup calendar.Note: Some...
Read more >Text function in Power Apps - Power Platform
The Text function formats a number or a date/time value based on one of ... Use this to pass non-text values to text-based...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@M1CK431 In fact the date-time’s panel doesn’t follows dateFormat now, we will try to fix it.
I was missing
monthBeforeYear: true
in my custom locale file