mat-datetimepicker
mat-datetimepicker copied to clipboard
Min and Max dates not working
<mat-datetimepicker #datetimePickerEnd type="datetime" [min]='minDate' openOnFocus="true" timeInterval="5" ></mat-datetimepicker>
Min date not working, however it works on md2. How am I able to get this to work?
Thanks
Make sure the date is of the correct type moment/date. There are examples in the repository. https://github.com/kuhnroyal/mat-datetimepicker/issues/34
Is this still an issue or did you solve your problem?
Hi. Looks like I'm having the same issue. Everythings works great until i add [min]
The Angular error:
Can't bind to 'min' since it isn't a known property of 'mat-datetimepicker'.
- If 'mat-datetimepicker' is an Angular component and it has 'min' input, then verify that it is part of this module.
My HTML
`
<mat-datetimepicker-toggle [for]="datePicker" matSuffix></mat-datetimepicker-toggle>
<mat-datetimepicker [min]="startDate" #datePicker type="date" openOnFocus="true"></mat-datetimepicker>
<input matInput [matDatetimepicker]="datePicker" formControlName="DateBegin" required autocomplete="false" >
`
And in my component :
startDate = moment();
I'm currently using the 2.0.1 version.
@StephaneC I think it has to be applied to the input field not the mat-dattimepicker field