IliaIdakiev / angular-material-timepicker

Angular Material Timepicker Input for Template and Reactive forms

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MinDate and MaxDate are not working

Totati opened this issue · comments

Hi, I can't set a min and max value/validator, when using a control. Example, Without the control it's set, but you can't change it.

https://github.com/IliaIdakiev/angular-material-timepicker/blob/master/projects/mat-timepicker/src/lib/timepicker.directive.ts#L486

The isFirstChange should be called because it's a function

Thanks for opening this issue. I will resolve it later today and I will close the issue after that.

@Totati fixed in mat-timepicker@4.1.5. Thanks again.

@IliaIdakiev Thank you for the quick response! Sadly the Reactive version is still imperfect. I've updated the stackblitz example. When the page loads and you open the timepicker you can see every button is enabled. After updating the max value, they get disabled correctly, but the control won't get into invalid state. (on update the control value is set one hour after the maxDate).

@Totati that's strange I will check it out now

@Totati can you test with mat-timepicker@4.1.6. It should be working now.

I've just updated the module to mat-timepicker@4.1.7. 4.1.6 had a problem with existing reactive form validators. Now everything should be working as expected.

Thank you very much :)

Thank you very much :)

No probs. Have a good one :)

@IliaIdakiev Hello again 🙃 I've found some other bugs

  1. Update the maxDate, and the input will be still invalid
  2. Delete the input value, and it will be still invalid. Empty values should be treated as valid, because of the Validators.required.

mat-timepicker@4.1.8