facebook

unable to use mat-date-range-picker-actions

  1. CodeMix & Angular IDE
  2.  > 
  3. Getting Help
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #671798 Reply

    knowledgeplaces
    Participant

    I use MyEclipse to build an Angular 10 application which uses Angular material.
    In this application, I have a component template using a date range picker as presented here:
    https://next.material.angular.io/components/datepicker/overview

    I have the exact same code in my app (excerpt below):

                        <mat-form-field appearance="fill">
                            <mat-label i18n>Validity period</mat-label>
                            <mat-date-range-input [rangePicker]="validityPeriodPicker">
                                <input matStartDate formControlName="accountStartDate">
                                <input matEndDate formControlName="accountEndDate">
                            </mat-date-range-input>
                            <mat-datepicker-toggle matSuffix [for]="validityPeriodPicker"></mat-datepicker-toggle>
                            <mat-date-range-picker #validityPeriodPicker>
                                <mat-date-range-picker-actions>
                                    <button mat-button matDateRangePickerCancel>Cancel</button>
                                    <button mat-raised-button color="primary" matDateRangePickerApply>Apply</button>
                                </mat-date-range-picker-actions>
                            </mat-date-range-picker>
                        </mat-form-field>

    I cannot compile since I have the following error on tag :
    ‘mat-date-range-picker-actions’ is not a known element:

    If I remove this tag, it compiles.

    Please tell me how to fix this, as my code is exactly the same as the sample code provided by Angular.

    #671809 Reply

    support-swapna
    Moderator

    Hi,

    It looks like you need to update the Angular Material version for the actions to work.
    Please see similar report here and check if updating the Material version helps : https://stackoverflow.com/questions/66132625/getting-error-mat-date-range-picker-actions-is-not-a-known-element

    –Swapna
    Genuitec Support

    #671814 Reply

    knowledgeplaces
    Participant

    Hi Swapna,

    Thanks, I have updated the required librairies and it compiles fine now.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: unable to use mat-date-range-picker-actions

You must be logged in to post in the forum log in