Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Min and Max dates not working #43

Open
ghost opened this issue Aug 22, 2018 · 4 comments
Open

Min and Max dates not working #43

ghost opened this issue Aug 22, 2018 · 4 comments
Assignees
Projects

Comments

@ghost
Copy link

ghost commented Aug 22, 2018

    <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

@kuhnroyal
Copy link
Owner

Make sure the date is of the correct type moment/date. There are examples in the repository.
#34

@kuhnroyal
Copy link
Owner

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

@kuhnroyal kuhnroyal added this to To do in 3.0.0 via automation Dec 16, 2018
@kuhnroyal kuhnroyal self-assigned this Dec 16, 2018
@scastrec
Copy link

scastrec commented Dec 17, 2018

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.

@jcanning
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
3.0.0
  
To do
Development

No branches or pull requests

3 participants