Closed Farplaner closed 7 years ago
@Farplaner It is not reverted AFAIK. If you change ngModel
by program, it does not change. This behaviour is never fixed(https://github.com/ng2-ui/ng2-datetime-picker/issues/143) and waiting for help.
What I meant was, that this commit https://github.com/ng2-ui/ng2-datetime-picker/commit/bd23140910b5968bb7d777cd18f34a9ac4311ea1 is not found in the latest codebase. It got lost between builds 0.13 and 0.14
See: https://github.com/ng2-ui/ng2-datetime-picker/blob/0.13.2/src/ng2-datetime-picker.directive.ts
Vs
https://github.com/ng2-ui/ng2-datetime-picker/blob/0.14.0/src/ng2-datetime-picker.directive.ts
(See ngOnChanges method)
That lines have been removed because of the refactoring.
If the issue happens again, could you tell me how to re-produce the error? I might not have enough test cases. My test passes, but I don't think it covers all.
@allenhwkim I used ng2-datetime-picker and I want to closed it when I clicked on input box.I tried it by developing my code using various types.Please give your kind regards to my problem.
Here's a plunkr that shows the problem: https://plnkr.co/edit/PcRGgUwSWk7XWcME0gt0?p=preview
When you click the button, the updated date is not formatted.
@Farplaner thanks for it. It's duplicate issue of #143. I have tried, failed, thus it was never fixed. Only thing you can do is to add toString
method to your ngModel at this moment. :(
this.myDate.toString= () => Ng2Datetime.formatDate(myDate, `YYYY-MM-DD`)
I'm sorry that maybe I didn't get my intent across... but this commit https://github.com/ng2-ui/ng2-datetime-picker/commit/bd23140910b5968bb7d777cd18f34a9ac4311ea1 actually fixed the problem for me, but it was removed due to refactoring.
OK, I will put that back and try, and check again.
@Farplaner you were right, I made it back and tested and it worked. Thanks for your patience.
Thank you for the fix. I updated to the new 0.14.6 version and it works for me now.
It seems that issue #123 was reverted in commit listed here: https://github.com/ng2-ui/ng2-datetime-picker/commit/932ec8768d3985ab1f4f1c66c553cbbc5c2546e2
With the code reverted, the issue happens again when the ngModel date changes externally, the date in the textbox does not get formatted.