跳转到主要内容

markCalendar

Description

为特定日期添加一个 CSS 类

markCalendar: (calendar: any, date: Date, css: string) => void

Parameters

  • calendar - (required) object - 日历实例
  • date - (required) Date - 需要高亮显示的日期
  • css - (required) string - 要应用的 CSS 类名

Example

<style>
my_style{
color:red !important; // 使用 'important' 关键字确保样式应用于该日期
}
</style>
<script>
// 获取日历对象有两种方式:

// 通过创建一个迷你日历
var calendar = scheduler.renderCalendar({...});

// 或者通过选择迷你日历的容器元素
var calendar = document.querySelector(".dhx_mini_calendar");

...
scheduler.markCalendar(calendar, new Date(2010,3,1), "my_style");
</script>

Details

注释

该方法需要启用 minical 插件。

注释

请注意,此方法仅适用于迷你日历,不适用于整个 scheduler。

Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.