我有复发规则(例如“FREQ = WEEKLY; BYDAY = WE”),开始日期和结束日期。 我在哪里可以找到方法或功能来检查当前日期是否进入我的规则?
例如,如果我有:开始日期:01.02.2017结束日期:03.02.2017重复规则:“FREQ = DAILY; NTERVAL = 5”
因此,在这种情况下,日期4.02.2017不会输入此规则,但日期5.02.2017会输入此规则。
I have recurrence rule(for example like "FREQ=WEEKLY;BYDAY=WE"), start date and end date. Where can I find method or function to check is current date enters in my rule or not?
For example if I have: Start date: 01.02.2017 End date: 03.02.2017 Recurrence rule: "FREQ=DAILY;NTERVAL=5"
So, in this case date 4.02.2017 not enters in this rule, but date 5.02.2017 enters in this rule.
最满意答案
你可以像这样使用调度器的occurrencesInRange方法:
var scheduler = $("#scheduler").data("kendoScheduler"); var events = scheduler.occurrencesInRange( new Date("2017-02-05"), // The date you want to check at 0:00 am new Date("2017-02-06") // The same date + 24 hours );你会得到那个日期的重复日期列表。 如果数组不为空,那么提供上述方法的开始日期就会出现。
You can use the scheduler's occurrencesInRange method like this:
var scheduler = $("#scheduler").data("kendoScheduler"); var events = scheduler.occurrencesInRange( new Date("2017-02-05"), // The date you want to check at 0:00 am new Date("2017-02-06") // The same date + 24 hours );You'll get a list of recurring dates in that date. If the array isn't empty then the start date you supplied the above method has an occurance in it.
更多推荐
发布评论