簡體   English   中英

指定FullCalendar上多日活動的開始和結束時間

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

我在FullCalendar發生以下事件:

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

因此,我的活動從4月15日開始,到4月17日結束,並且每天從上午8點到下午5點進行。 但是FullCalendar在周和日視圖中顯示事件,好像事件從4月15日上午8點到4月17日下午5點不間斷地發生。 像這樣:

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

我希望該活動跨越這3天,但只顯示每周和每天視圖的每天上午8點至下午5點。 像這樣:

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

能做到嗎? 我應該如何設置事件屬性來實現此目的?

您必須使用eventConstraint陶氏指數(星期幾),請參閱文檔

例:

             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