Use locale order when listing weekdays #54
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 thelocaleOrder
-flag set totrue
.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