-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Datepickers do not allow to type dates when nzFormat is different than default #5654
Comments
You should import date-fns. https://ng.ant.design/docs/i18n/en#how-to-format-a-date-using-date-fns. |
We should add this in document. 🤔 |
It works indeed, thank you very much! |
@valerio-lucantonio what exactly did you do to make it work? In app.module.ts I import import de from '@angular/common/locales/de'; and set providers like this: In my component I use dateRangePicker: When clicking on the RangePicker to select a Date it throws an error: |
The value of |
I overlooked the comment So I manually set the value NZ_DATE_LOCALE in my app.module.ts like this so that I can use it as a provider: Is this the way I should do it? It removed the error, but still DateRangePicker doesn't allow to type dates when I set nzFormat="yyyyMMdd" |
Sorry, this is odd. Now I got it working: import { NZ_I18N, NzModalModule, NzNotificationModule, NZ_DATE_LOCALE } from 'ng-zorro-antd'; { provide: NZ_DATE_LOCALE, useValue: deDateLocale }, Thank you very much for your support, @wenqi73 |
when i try to import deDateLocale from 'date-fns/locale/de', it gives me error : |
Reproduction link
https://stackblitz.com/edit/angular-dnrngb
Steps to reproduce
What is expected?
to be able to write dates according to the nzFormat
What is actually happening?
nothing happens. The date are not modified
would be cool on tab out to close the flyout as well
The text was updated successfully, but these errors were encountered: