angular-material-components icon indicating copy to clipboard operation
angular-material-components copied to clipboard

Date does not update in the picker when switching on the same day

Open hp561 opened this issue 2 years ago • 5 comments

I have a input box that binds the date to the date on the datepicker component. However, if I change the date in the input box to a different time of the day, and then click the datepicker icon, the date that shows up is the previous date. How can I fix this or if there is a hacky workaround?

hp561 avatar Sep 10 '21 15:09 hp561

I had the same issue. Try setting the picker._selected property to the updated date, this worked for me.

waztsup avatar Oct 05 '21 14:10 waztsup

I had the same issue. Try setting the picker._selected property to the updated date, this worked for me.

Hmm I’m not sure how to go about this. Could you give a code example?

hp561 avatar Oct 06 '21 15:10 hp561

Here is a reproduction with a workaround:

https://stackblitz.com/edit/demo-ngx-mat-datetime-picker-angular9-rfyji1?file=src/app/app.component.ts

DanielHabenicht avatar Nov 04 '21 12:11 DanielHabenicht

Here is a reproduction with a workaround:

https://stackblitz.com/edit/demo-ngx-mat-datetime-picker-angular9-rfyji1?file=src/app/app.component.ts

Thank you so much!! It works beautifully now!

hp561 avatar Nov 04 '21 16:11 hp561

Can you leave the issue open? Because I dont think it's intended to set it extra.

DanielHabenicht avatar Nov 04 '21 17:11 DanielHabenicht