JQuery UI 日期选择器更改一天的样式

JQuery UI Datepicker Change Style for a Day

我正在写一个简单的脚本。

我在非工作日从数据库读取数据,我想更改这些天的 background/font 颜色。当我点击一天时,我会切换它 background/font 颜色。

对于非工作日,我不是说周末,而是因为 国定假日 而不是工作日。

如何修改日期选择器中的特定日期?这可能吗?我可以设计和编写自定义日历吗?

谢谢

之前有人问过这个问题,我想这个(连同 fiddle)回答了你的问题:

jQuery UI datepicker: How to color sundays red?

Datepicker 有一个 .ui-datepicker-week-end 元素,您可以使用它相应地更改 background/font。上面给出的一个例子是:

.ui-datepicker-week-end a {
    background-image: none;
    background-color: red;
}

如果您想设置颜色 属性 而不是 background-color,您确实必须使用 !important:

.ui-datepicker-week-end a {
    color: red !important;
}

添加专门针对更改银行假日日期的答案以供将来参考。这是一个很好的分步指南。

http://www.jquerybyexample.net/2012/05/highlight-specific-dates-in-jquery-ui.html