简体   繁体   中英

PrimeNG p-calendar: change the background-color of the dates

Hi I'm trying to customize the p-calendar but can't figure out how to change the color of the dates that are being displayed. Please Help. Thanks in advance.

This is my template:

<div class="p-field p-col-12 p-md-4">
    <label for="time">Time</label>
    <p-calendar [(ngModel)]="date7" [showTime]="true" [inline]="true" inputId="time"></p-calendar>

</div>

My Css:

  ::ng-deep .ui-datepicker .ui-datepicker-group {
     background-color: whitesmoke;
 }

  
  ::ng-deep .ui-datepicker .ui-widget-content {
     border: 1px solid #888888;
     font-weight: normal;
     color: #000000;
     background-color: red

 }

Use .p-datepicker instead of .ui-datepicker

CSS :

::ng-deep .p-datepicker table td > span {
  background-color: orange;
}

::ng-deep .p-datepicker table td.p-datepicker-today > span {
  background-color: burlywood;
}

See demo

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM