0
votes

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

1

1 Answers

2
votes

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