如何创建我自己的日历而不是像石英调度程序中的假期日历那样排除日期

How to create my own calendar instead of excluding date like holiday calendar in quartz scheduler

我想创建自己的日历示例:在一个月内,一年可以有 33 天和 53 周。

您只需要实现 Quartz Calendar interface or extends Quartz BaseCalendar class and implement/override getNextIncludedTime and isTimeIncluded methods. Then you simply register the new calendar implementation with Quartz by invoking scheduler.addCalendar(name, new YourCalendar(), true, true)。从现在开始,您可以让您的触发器引用您的自定义日历以排除任何您想要的 dates/daytimes。