Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locale DateTime format not used in NDatePicker (input inside the dropdown) + update fr-FR locale date separator #1793

Closed
M1CK431 opened this issue Dec 8, 2021 · 6 comments
Labels
bug Something isn't working documentation Improvements or additions to documentation priority: high

Comments

@M1CK431
Copy link
Contributor

M1CK431 commented Dec 8, 2021

TuSimple/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:
image

@github-actions github-actions bot added the untriaged need to sort label Dec 8, 2021
@M1CK431 M1CK431 changed the title Locale DateTime format not used in NDatePicker (input inside the dropdown) update fr-FR locale date separator Locale DateTime format not used in NDatePicker (input inside the dropdown) + update fr-FR locale date separator Dec 8, 2021
@Talljack
Copy link
Contributor

Talljack commented Dec 9, 2021

@amadeus711

@Talljack Talljack added documentation Improvements or additions to documentation and removed untriaged need to sort labels Dec 9, 2021
@07akioni
Copy link
Collaborator

07akioni commented Dec 9, 2021

@M1CK431 In fact the date-time's panel doesn't follows dateFormat now, we will try to fix it.

@07akioni
Copy link
Collaborator

07akioni commented Dec 16, 2021

I'll fix it in this weekend

@07akioni 07akioni added bug Something isn't working priority: high labels Dec 16, 2021
@M1CK431
Copy link
Contributor Author

M1CK431 commented Dec 16, 2021

Hi @07akioni , thanks a lot.

I have notice a new translation for quarter selection:
https://github.com/TuSimple/naive-ui/blob/9d0558ae0989a160f72ddf2d0499eaa139f36cf6/src/locales/common/frFR.ts#L42-L43

The Fr translation is: Sélectionner le trimestre.

And for:
https://github.com/TuSimple/naive-ui/blob/9d0558ae0989a160f72ddf2d0499eaa139f36cf6/src/locales/common/frFR.ts#L32

The FR format is qqq yyyy.

Also please don't forget to update the FR date separator (and sorry again, its my mistake).

@wc-matteo
Copy link

I receive: Cannot read properties of undefined (reading 'monthBeforeYear') when clicking on a NDatePicker with a date

@wc-matteo
Copy link

I was missing monthBeforeYear: true in my custom locale file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation priority: high
Projects
None yet
Development

No branches or pull requests

4 participants