简体   繁体   中英

Fullcalendar event recurring end time incorrect

I am facing an issue to do weekly or daily recurring event using FullCalendar. On my appointment slot for daygrid. The end time for the slot is incorrect. It should appeared from 11:45:00 to 16:45:00 but the actual result i get from the view is displaying from 11:45:00 to 12:45:00 .

events.push({
  id: value.id,
  resourceId: value.user_id,
  rrule: {
    freq: 'weekly',
    byweekday: ['mo', 'tu', 'we', 'th'],
    dtstart: value.start_date + ' ' + value.start_time, //current value: 2020-06-03 11:45:00
    until: value.end_date + ' ' + value.end_time //current value: 2020-06-30 16:45:00
  }
  display: 'background',
  exdate: ['2021-06-03']
});

The until date specifies when the whole recurrence period should end. It does not specify the length of each individual event.

The fullCalendar Rrule documentation mentions the duration property which you can specify in order to do that:

duration
Must be something that parses into a Duration. If not specified, each event will appear to have the default duration

11.45 - 16.45 is 5 hours, so if you set

duration: "05:00"

as a property of the event, then this will have the desired effect.

Demo: https://codepen.io/ADyson82/pen/ZEerKJJ

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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