Open ghost opened 3 years ago
Seems similar case #1225
For now if it is possible I suggest to use moment
or date-fns
.
Please see Formatting issues
https://akveo.github.io/nebular/docs/components/datepicker/overview#nbdatepickerdirective
@andreipadolin Could you explain how to use NbMomentDateService? I import NbMomentDateModule and provide NbMomentDateService. But I don't know how to use it to change locale, the doc on website is not enough clear for me. Thanks!
@andreipadolin I think maybe I misunderstanding. The service cannot set display language now, right? I want to change display language on nb-datepicker
@andreipadolin I got it, just use angular's i18n feature.
import { registerLocaleData } from '@angular/common';
import zh_Hant from '@angular/common/locales/zh-Hant';
registerLocaleData(zh_Hant, 'zh-tw'');
@NgModule({
...
providers: [
{ provide: LOCALE_ID, useValue: 'zh-tw' },
],
...
});
I'm having the same issue with the NbRangepicker using 'es', works fine in 'en'. Did someone find a solution for this yet? thank you! :)
Edit: It has to be something associated with the name of the month, because in some months it works, such as February, whose first 3 acronyms coincide with their corresponding translation February (feb = feb). This is not the case of January, for example, whose 3 initials do not match (ENE != JAN).
Issue type
I'm submitting a ... (check one with "x")
Issue description
Current behavior:
NbDatepicker
andNbRangepicker
doesn't work properly withes
locale. Once the AngularLOCALE_ID
has been set the component doesn't render some selected dates, specifically the April ones. If I remove theLOCALE_ID
from theAppModule
providers it works well.Expected behavior: The component must work correctly with 'es' locale.
Steps to reproduce: Set up the
LOCALE_ID
withes
locale and select a date in April. It's happening something similar withes-CO
locale.Related code: I built a small project with the minimum needed to reproduce the Bug: nb-datepicker-es-locale-issue
Other information:
npm, node, OS, Browser
Angular, Nebular
Thanks for the help!