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

Use locale order when listing weekdays #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

awesomund
Copy link

@awesomund awesomund commented Feb 22, 2022

Hi, thanks for a great library!

As I was trying it out, i noticed what I think is a bug when changing the locale for dayjs before rendering the Datepicker component: if the week starts on a different day for the given locale (e.g. monday), the weekdays and dates will not match.

In my example, I was setting dayjs's locale to 'nb' (norwegian bokmål) before rendering the datepicker. Names of months and weekdays are correctly set according to the given locale, but the weekdays and dates do not match since dayjs.weekdaysShort() is not called with the localeOrder-flag set to true. dayjs.weekdaysShort(true) will return a list of weekdays where the order matches the locale used (e.g. monday first).

I couldn't find any way to enforce localOrder in my own dayjs config at first glance, so this seemed like the only solution that would work for me. Sorry if I'm missing something obvious!

The localeOrder feature in dayjs: iamkun/dayjs#936

@antony
Copy link
Member

antony commented Feb 23, 2022

Hey - thanks for this!

I've not really played with locales much at the moment, though it's on my radar. I'll have a look at this and see if it is the right solution.

I might also be getting rid of dayjs because I think it's the wrong solution for a third party library.

@antony
Copy link
Member

antony commented Aug 23, 2023

@beyonk-group/engineering this is probably a blocker to i18n. We probably need to start planning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants