question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

error (Angular Material - datepicker): Type MatDatepicker is not assignable to type MatDatepickerPanel<MatDatepickerControl

See original GitHub issue

Is 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: image

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:closed
  • Created 2 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
crisbetocommented, Mar 16, 2022

Oh, I’m sorry, I must’ve misread it. Reopening.

0reactions
angular-automatic-lock-bot[bot]commented, May 28, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found