gpt4 book ai didi

javascript - 在 FullCalendar 上指定多日事件的开始和结束时间

转载 作者:行者123 更新时间:2023-11-28 07:26:39 25 4
gpt4 key购买 nike

我在 FullCalendar 上发生了以下事件:

{ title : "My Meeting" , start : "2015-04-15T08:00", end : "2015-04-17T17:00" }

所以我的事件从 4 月 15 日开始,到 4 月 17 日结束,每天上午 8 点到下午 5 点进行。但 FullCalendar 以周和日 View 显示该事件,就好像它从 4 月 15 日上午 8 点到 4 月 17 日下午 5 点不间断发生一样。像这样:

  • 4 月 15 日:上午 8 点至 12 点;
  • 4 月 16 日:上午 12 点至凌晨 12 点;
  • 4 月 17 日:上午 12 点至下午 5 点。

我希望事件跨越这 3 天,但仅在周 View 和日 View 中每天上午 8 点到下午 5 点显示。像这样:

  • 4 月 15 日:上午 8 点至下午 5 点;
  • 4 月 16 日:上午 8 点至下午 5 点;
  • 4 月 17 日:上午 8 点至下午 5 点。

这可以做到吗?我应该如何设置事件属性来实现此目的?

最佳答案

您必须使用 eventConstraint dow(星期几),请参阅 documentation

示例:

             var event = [{
title: "My repeating event",
start: '10:00', // a start time (10am in this example)
end: '14:00', // an end time (2pm in this example)
dow: [1, 4], // Repeat monday and thursday
ranges: [{start: "2017-07-01", end: "2017-07-15"},]
},
{
title: "My repeating event 2",
start: '10:00', // a start time (10am in this example)
end: '14:00', // an end time (2pm in this example)
dow: [1, 4], // Repeat monday and thursday
ranges: [{start: "2017-08-01", end: "2017-08-15"},]
}
];

关于javascript - 在 FullCalendar 上指定多日事件的开始和结束时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29585580/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com