mat-datetimepicker icon indicating copy to clipboard operation
mat-datetimepicker copied to clipboard

Min and Max dates not working

Open ghost opened this issue 6 years ago • 4 comments

    <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

ghost avatar Aug 22 '18 14:08 ghost

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

kuhnroyal avatar Aug 22 '18 16:08 kuhnroyal

Is this still an issue or did you solve your problem?

kuhnroyal avatar Dec 16 '18 16:12 kuhnroyal

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'.

  1. 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.

scastrec avatar Dec 17 '18 15:12 scastrec

@StephaneC I think it has to be applied to the input field not the mat-dattimepicker field

jcanning avatar Jan 28 '19 20:01 jcanning