angulartypescriptdatepickerprimeng

Angular- Primeng calender not displaying past end date values if minDate is current Date


Primeng calender not displaying past end date values if minDate is current Date, How to display the past dates without using any [disabledDates] property?

Below is the code:

<p-calendar  [showIcon]="true"
inputId="icon" [minDate]="minDate" [showOtherMonths]="false" dateFormat="dd-M-yy"
formControlName="LICENCE_END_DATE"></p-calendar\>

When minDate is new Date(), then the value of formcontrolname - LICENCE_END_DATE is 'Wed Jul 31 2024 23:59:59 GMT+0530 (India Standard Time)' viz past value.

Even though both minDate and selected date formats are similar, p-calender control not displaying past value.


Solution

  • use [keepInvalid]="true"