0

I like to set default Dates for p-calendar PrimeNG component, how do I do that in Angular?

Antikhippe
  • 6,316
  • 2
  • 28
  • 43
kenadet
  • 245
  • 5
  • 13

1 Answers1

2

Use ngModel for that.

<p-calendar [(ngModel)]="value"></p-calendar>

and set your specific date for value property. For instance, if you want to set a date one month before today :

this.value = new Date();
this.value.setMonth(this.value.getMonth() - 1);

See Plunker

Antikhippe
  • 6,316
  • 2
  • 28
  • 43