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

not able to filter minute using matDatepickerFilter #102

Open
dass80056 opened this issue Apr 11, 2020 · 0 comments
Open

not able to filter minute using matDatepickerFilter #102

dass80056 opened this issue Apr 11, 2020 · 0 comments

Comments

@dass80056
Copy link

dass80056 commented Apr 11, 2020

this is my html code

Start DateTime
<input matInput formControlName="startDate" [matDatetimepicker]="dts" required autocomplete="false" [matDatepickerFilter]="dateFilter">
<mat-datetimepicker-toggle [for]="dts" matSuffix>
<mat-datetimepicker #dts type="datetime" openOnFocus="true" timeInterval="5">

ts file:
dateFilter = (d: Date): boolean => {
let date= d.getMinutes();
return date ==0 || date ==30;
}

I want to just enable the 00 and 30 minute option.
here when the minute comes up then In the UI it shown as disable but when I click using mouse on the disabled minute then it takes that minute in the input.

It seems like matDatepickerFilter is only working properly till the day filtering when it comes to timing it is not compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant