angularprimengangular-bootstrap-calendar

p calendar readonly not working in primeng


<p-calendar readonly="true" [showTime]="true" inputId="time" [hourFormat]="24" [minDate]="minDate" [maxDate]="tomorrow" inputId="range" [(ngModel)]="obj.date" formControlName="selectedDateTime">


Solution

  • Readonly property doesn't exist in p-calendar. You can use the "disabled" property instead.

        <p-calendar 
        disabled="true" 
        [showTime]="true" 
        inputId="time" 
        [hourFormat]="24" 
        [minDate]="minDate" 
        [maxDate]="tomorrow" 
        inputId="range" 
        [(ngModel)]="obj.date" 
        formControlName="selectedDateTime"></p-calendar>