-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Khronos locale error: please load locale "en" before using it #4752
Comments
fixed for now by downgrading from 3.1.1 to 3.0.1 |
@dmitry-kostin Could you be more specific or/and provide a reproduction of this issue. |
maybe related #4754 |
@Domainv are you sure that this issue depends on the one you linked? because that one is open since September. While our issue affects only 3.1.1 and not 3.0.1 of ngx-bootstrap |
|
@adrienverge I know, I am working on avoiding the problem |
I may have found part of the issue. I was getting the "Khronos locale error: please load locale...." issue and tried about everything. I created a brand new project and isolated my issue the compiler options setting for target in my tsconfig.json. I had it set to: "target": "es6" but when I set it to "target": "es5" the issue disappears. While this is "Ok" for me right now, my guess it the root error should be investigated and fixed sooner rather than later |
I am also facing the same issue "Khronos locale error: please load locale "hi-in" before using it". I tried with target: "es5" still getting the same error. |
this issue is closed, please open a new one if you think to have found a bug |
The right solution for this is to add the defineLocale(‘es’, esLocale) in your component constructor, just before you call this.localeService.use(‘es’):
hope this helps... using: |
### In order to acheive localisation in ngx date picker, need to import all possible locales of ngx-datepicker by import locales in defineLocale([localecode], [locale-object])
|
this worked for me ;) |
@barrita . Your solution is right. But if you want to show french locale you need to load once again . So that we can loop over the list of locales and load it. Find above solution to load all locales |
I just updated to angular 7 and started to get following errors when I open datepicker:
Khronos locale error: please load locale "en" before using it
ERROR TypeError: Cannot read property 'firstDayOfWeek' of null
I already had played with
defineLocale('en')
andthis.localeService.use('en')
but had no luckAnybody can explain this? From docs it seems 'en' is already default locale and no need to setup nothing else.
btw I have moment and moment-timezone installed but never changed any locales there too
ps edit
listLocales() returns empty array as well, and its supposed to return ['en'] at least
The text was updated successfully, but these errors were encountered: