-
-
Notifications
You must be signed in to change notification settings - Fork 318
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
generateConfig for date-fns throws error for some locales #147
Comments
Same problem with ru_RU locale |
Same problem with de, fr locale |
Hi, guys. Could you help to send PR about this? |
I created a pull request to fix this: #289 |
@zombieJ are there any issues regarding spawnia's PR? |
Is there any way we can finally fix this after 2 years? German is still not working like other languages too... |
Yup, merging #289 or implementing #289 (comment) would do it. |
@spawnia That is what I was asking for 🥲 |
The
generateConfig
methods usedealLocal()
function to getdate-fns
specific locale data for the provided language, but the implementation fails in some cases becauserc-picker
locales names do not exactly match withdate-fns
ones.For example Italian:
rc-picker
useit_IT
as locale name;dealLocal()
converts it intoitIT
;generateConfig.getWeekFirstDay()
method tries to loaddate-fns
locale data with anitIT
key, but it does not exists and this leads toclone
constant to beundefined
.The only solution is to replace the current
dealLocal()
implementation with a static map of locales names and prevent errors with a default value:The text was updated successfully, but these errors were encountered: