valor-software / ngx-bootstrap

Fast and reliable Bootstrap widgets in Angular (supports Ivy engine)
https://valor-software.com/ngx-bootstrap
MIT License
5.53k stars 1.69k forks source link

Datepicker do not display numbers #5765

Open JJayet opened 4 years ago

JJayet commented 4 years ago

Hi,

I've been using the datepicker component for a while and I recently updated our project to Angular 9.1 and ngx-bootstrap 5.6. Since then, the numbers do not appear in the calendar. I tried rolling back Angular and ngx with no success. What's weird is that the day labels do in fact appear and are localized (we use french and english locales).

I don't have a clue as to what could be causing the bug and I don't have any error in the console.

Thanks,

Best, Jonathan

image

JJayet commented 4 years ago

Found it!

We were defining a locale defineLocale('en', enGbLocale) which conflicted with: https://github.com/valor-software/ngx-bootstrap/blob/development/src/chronos/locale/locales.ts#L233

Therefore no formatting function would apply.

I'd classify this as a bug and forbid users from defining a en locale.

Best, Jonathan

andreidiaconescu commented 4 years ago

Hello @JJayet I have the same problem, So how should we use defineLocale() and the datePicker to actually see the numbers ?

Thank you !

JJayet commented 4 years ago

Hello @andreidiaconescu

As I've said, the issue we had was with defining a 'en' locale as such defineLocale('en', enGbLocale). This created a conflict and prevented the propagation of the translations.

Now our code only defines one locale (fr) and the 'en' one is created automatically. So, if by any means you have defineLocale('en', enGbLocale) in your code, just remove it and it should work again.