Need to highlight the previous date by default with p-calendar control in Angular

p-calendar highlights current date by default. I need to highlight the previous date by default in p-calendar control. I am new to Angular. pls guide

Hello @shivanisid, welcome to the freeCodeCamp forums!

I’m not sure what the p-calendar component is, or what its API surface looks like, do you have any docs/links to what your using?

My assumption is that this component can take in some kind of value for the “defaultDate”, that value can be passed into it and the component should take care of the rest.

So something like:

<p-calendar [defaultDate]="myDefaultDate">

Again, this assumes the attribute is named defaultDate.

I recommend reading more about component communication here:

You also might be creating these components within a form, in which case you could leverage the form’s api:

Hopefully those are at least starting points.

Good luck, keep learning, keep growing :+1:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.