首页 > 解决方案 > 在 ng-pick-datetime 中更改给定日期的样式

问题描述

我在前端使用Angular 日期时间选择器

我在后端的方法为用户计算所有不可用的日期。我想在用户不可用的每一天更改日历中的颜色。基本上我想找到一种方法来通过在不可用的日子改变颜色来设置组件的样式。

我似乎找不到办法;有人能指出我正确的方向吗?或者甚至可能推荐另一种方法来做到这一点。

标签: angularnpmdatetimepicker

解决方案


在这里你可以改变颜色 -----> src\styles.scss

例如

.owl-dt-calendar-table .owl-dt-calendar-cell-in-range {
    background: rgba(255, 0, 0, 0.2);
}

.owl-dt-container-info .owl-dt-container-info-active {
    color: red;
}

.owl-dt-calendar-table .owl-dt-calendar-cell-selected {
    color: rgba(255, 255, 255, .85);
    background-color: red;
}

.owl-dt-container-buttons {
  color: #3f51b5;
}

图片在这里


推荐阅读