Skip to content
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

Issue with NgbDateAdapter when used with a Datepicker on an input #2002

Closed
msosa opened this issue Nov 30, 2017 · 1 comment
Closed

Issue with NgbDateAdapter when used with a Datepicker on an input #2002

msosa opened this issue Nov 30, 2017 · 1 comment

Comments

@msosa
Copy link
Contributor

msosa commented Nov 30, 2017

Bug description:

Using NgbDateAdapter with anything other than the original NgbDateStruct will not work with a datepicker on an input. It looks like this was missed in my previous PR and when selecting a date from the popup it will show as blank on the input even though the model gets updated. I have something sort of working but having issues with dealing with any type of invalid input and it just causes it to crash. If i take out the second ternary here in datepicker-input on the function manualDateChange, it does end up fixing the crashing error after all my other changes. Not sure if that is the right solution though.

 this._onChange(this._model ? this._model.toStruct() : (value === '' ? null : value));

If it helps I can open up a PR with the potential fix

Link to minimally-working plunker that reproduces the issue:

As this is not yet released I cannot make a plunker

Version of Angular, ng-bootstrap, and Bootstrap:

ng-bootstrap: master branch

@maxokorokov
Copy link
Member

Indeed, we kinda forgot about the ngbInputDatepicker...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants