Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

370
Vistas
Change header of an inline datepicker angular material

To change the header of a datepicker in angular material we use [calendarHeaderComponent] e.g

<mat-form-field>
  <mat-label>Date</mat-label>
  <input formControlName="date" matInput [matDatepicker]="picker" />
  <mat-datepicker-toggle matSuffix [for]="picker">
    <mat-icon matDatepickerToggleIcon svgIcon="calendar_day"></mat-icon>
  </mat-datepicker-toggle>
  <mat-datepicker color="primary" [calendarHeaderComponent]="datePickerHeader" #picker></mat-datepicker>
</mat-form-field>

To get the datepicker inline we use mat-calendar directly

  <mat-calendar [(selected)]="date"></mat-calendar>

The challenge is that If I try to use calendarHeaderComponent directive on this component it throws error that this attribute is not allowed here. How can I solve this?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Assuming customDatePickerHeader is your custom header component. Try binding as follows:

<mat-calendar [headerComponent]="customDatePickerHeader" [(selected)]="date"></mat-calendar>

I'd have referenced a documentation but not sure it's easy to find one for the inline mat-calendar component. Will edit post if I manage to find it.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda