简体   繁体   English

指定FullCalendar上多日活动的开始和结束时间

[英]Specify start and end times for multi-day event on FullCalendar

I have the following event on FullCalendar : 我在FullCalendar发生以下事件:

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

So my event starts on April 15th, and it ends on April 17th, and happens on each day from 8am to 5pm. 因此,我的活动从4月15日开始,到4月17日结束,并且每天从上午8点到下午5点进行。 But FullCalendar shows the event in week and day view as if it happens non-stop from April 15th at 8am to April 17th at 5pm. 但是FullCalendar在周和日视图中显示事件,好像事件从4月15日上午8点到4月17日下午5点不间断地发生。 Like this: 像这样:

  • April 15th: 8am to 12am; 4月15日:上午8点至12点;
  • April 16th: 12am to 12am; 4月16日:凌晨12点至12点;
  • April 17th: 12am to 5pm. 4月17日:上午12点至下午5点。

I want the event to span those 3 days, but only to show from 8am to 5pm on each day for the week and day view. 我希望该活动跨越这3天,但只显示每周和每天视图的每天上午8点至下午5点。 Like this: 像这样:

  • April 15th: 8am to 5pm; 4月15日:上午8点至下午5点;
  • April 16th: 8am to 5pm; 4月16日:上午8点至下午5点;
  • April 17th: 8am to 5pm. 4月17日:上午8点至下午5点。

Can this be done? 能做到吗? How should I set my event properties to achieve this? 我应该如何设置事件属性来实现此目的?

You have to use an eventConstraint dow (Day Of Week) see the documentation 您必须使用eventConstraint陶氏指数(星期几),请参阅文档

Example: 例:

             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"},]
                }
            ];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM