Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

514
Views
Angular - How to disable particular date in Datepicker?

I want to disable Monday from "mat-datepicker". So here is my code in the class component.

  dateFilter = (_date: any) =>{
    let day = _date.getDay();
    console.log(day);
    
    return day != 1;
  }

And in my template file :

 <input [matDatepicker]="picker" [matDatepickerFilter]="dateFilter" />
 <mat-datepicker (closed)="ClosePicker($event)" #picker></mat-datepicker>

But now after implementing this, I can't see any date on my calendar. And in the months section, I just see "February" available there. No other months are showing. Does anyone know how to fix this? I am willing to share more code if needed.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Please Use Min max function to select and disable certain date periord

By using Angular Material

<mat-form-field style="width:130px;" appearance="fill">
                        <input style="position: relative;top: -7px;" [min]="nestedMinDate" matInput [matDatepicker]="picker3"
                          [(ngModel)]="nestedReorder.PromiseDate"
                          (change)="dateFormating(nestedReorder.PromiseDate,i,j)">
                        <mat-datepicker-toggle matSuffix [for]="picker3"></mat-datepicker-toggle>
                        <mat-datepicker #picker3></mat-datepicker>
                      </mat-form-field>

Type Script Code

this.minDate= formatDate(new Date(), 'yyyy-MM-dd', 'en');
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!