Kendo UI Scheduler

系统教程 行业动态 更新时间:2024-06-14 16:57:18
Kendo UI Scheduler - 检查是重复规则中的日期(Kendo UI Scheduler - Check is date in recurrence rule)

我有复发规则(例如“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.

更多推荐

本文发布于:2023-04-12 20:33:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/abe714e4e3ee018f84885f84c07e0948.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Kendo   UI   Scheduler

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!