h2qutc / angular-material-components

Angular Material Library provide extra components for every project
https://h2qutc.github.io/angular-material-components/
MIT License
330 stars 165 forks source link

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

Open hp561 opened 3 years ago

hp561 commented 3 years ago

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?

waztsup commented 3 years ago

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

hp561 commented 3 years ago

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?

DanielHabenicht commented 3 years ago

Here is a reproduction with a workaround:

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

hp561 commented 3 years ago

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!

DanielHabenicht commented 3 years ago

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