-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
DatePicker doesn't recognize manual date input when using nzFormat #3976
Comments
Thanks for your report, we will support it until |
@wenqi73 date-fns has now released 2.0.0 so can this be looked at again please? |
@darshanrampatel Sure, we will work it out soon. |
Hello! Are there any updates on this? Thanks! |
Guys any update? |
I think problem is here:
Problem is const date = new CandyDate(input);. You should support new CandyDate with dev's format or convert to date with dev's format before new CandyDate. |
* feat(module:date-picker): support parse input value * test: fix tests * chore: support datefnsCompat option * fix: not import from i18n in core * chore: change API name and add docs * chore: change format convert from config to token * docs: update docs * chore: move some types * docs: update docs for date-fns update * chore: change name and add warning * docs: update docs Close #4028 Close #3976 Close #2492 Close #4101
* feat(module:date-picker): support parse input value * test: fix tests * chore: support datefnsCompat option * fix: not import from i18n in core * chore: change API name and add docs * chore: change format convert from config to token * docs: update docs * chore: move some types * docs: update docs for date-fns update * chore: change name and add warning * docs: update docs Close NG-ZORRO#4028 Close NG-ZORRO#3976 Close NG-ZORRO#2492 Close NG-ZORRO#4101
it is still not working on 9.2.2 |
@xdrago1 You should import date-fns by providing |
* feat(module:date-picker): support parse input value * test: fix tests * chore: support datefnsCompat option * fix: not import from i18n in core * chore: change API name and add docs * chore: change format convert from config to token * docs: update docs * chore: move some types * docs: update docs for date-fns update * chore: change name and add warning * docs: update docs Close NG-ZORRO#4028 Close NG-ZORRO#3976 Close NG-ZORRO#2492 Close NG-ZORRO#4101
I managed to solve this issue using date-fns Locale.
By doing this, all my date pickers worked fine. |
Reproduction link
https://stackblitz.com/edit/angular-a8d35n
Steps to reproduce
Add DatePicker component and set nzFormat="dd.MM.yyyy".
Manual input works only if date and month are same. For example, if we type 04.04.1995 it works, but 04.05.1995 is not working.
What is expected?
After writing string date, DatePicker changes date in the model.
What is actually happening?
Nothing happens
Default format working fine
The text was updated successfully, but these errors were encountered: