error (Angular Material - datepicker): Type MatDatepicker is not assignable to type MatDatepickerPanel<MatDatepickerControl
See original GitHub issueIs this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
I got this error when I tried to add a [max] value to my mat-datepicker:
Reproduction
Steps to reproduce: HTML:
<mat-form-field appearance="outline" class="date-picker">
<mat-label>Select Date</mat-label>
<input matInput
[matDatepicker]="datePicker"
formControlName="dateOfAppointment" readonly [max]="today"
>
<img class="calendar-icon" src="assets/icons/Calendar.svg" (click)="datePicker.open()" alt="Datepicker">
<mat-datepicker #datePicker></mat-datepicker>
</mat-form-field>
TS:
today = new Date();
Expected Behavior
To work without that error.
Actual Behavior
I got the error on my .html page.
Environment
- Angular: 13.2.3
- CDK/Material: 13.2.3
- Browser(s): Brave
- Operating System (e.g. Windows, macOS, Ubuntu): Windows.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
MatDatepicker is not assignable to parameter type ...
Moment>; Argument type MatDatepicker is not assignable to parameter type ... import {MatDatepicker} from '@angular/material/datepicker'; ...
Read more >Angular: type mismatch errors in template ("MatDatepicker is ...
Angular: type mismatch errors in template ("MatDatepicker is not assignable to parameter ... import { MatDatepicker } from '@angular/material/datepicker'; ...
Read more >Datepicker | Angular Material
Directive used to connect an input to a MatDatepicker. ... An input indicating the type of the custom header component for the calendar,...
Read more >[Solved]-MatDatepicker is not assignable to parameter type ...
[Solved]-MatDatepicker is not assignable to parameter type MatDatepicker<Moment>-angular.js. Search. score:0. Accepted answer.
Read more >Datepicker in Angular using mat-datepicker | Material Design
Date picker is a component which allow users to choose a date from the calendar pop up or enter a date through text...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh, I’m sorry, I must’ve misread it. Reopening.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.