0

I'm having a hard time getting a multiple day event to span correctly after I upgraded from Fullcalendar 3.9 to 4.0.1 and I'm starting to wonder if it is a bug or that I'm doing something wrong.

The event in the picture below called "10.00 Vossa Jazz 2019" is supposed to span from 12.4 to 14.4 - but only spans from 12.4 to 13.4. Vossa jazz

Fullcalendar gets the event from an eventSource - this file: https://ekstremedia.no/kk2/rapporter/Festivalar.json where you can see:

"start": "2019-04-12T10:00:00+02:00",

and

"end": "2019-04-14T22:00:00+02:00",

which is correct, 12.4 10:00 to 14.4 22:00. I've also tried allDay: true but it has the same behaviour.

Is this a bug or can somebody spot an error?

Demo and source: https://ekstremedia.no/kk2/kalender

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Terje Nesthus
  • 810
  • 3
  • 12
  • 30
  • 1
    In your calendar code you set `nextDayThreshold: "23:00"`. See https://fullcalendar.io/docs/nextDayThreshold to understand what the setting does. Your event ends at 22:00 so it ends too early, and so doesn't meet the threshold to be shown on that day. – ADyson Mar 28 '19 at 09:34
  • No, if I remove that setting completely, or set it to something else like "20:00" it is still the same. Nice find but it is not the issue I'm having. – Terje Nesthus Mar 28 '19 at 18:22
  • 1
    Ah...I think I know. `allDay` is `true` on that event...so the times are actually ignored. And then because the `end` value is **exclusive**, in actual fact the event is considered to end just before midnight of the 14th. i.e. it actually ends on the 13th at 23:59:59. And that's why it doesn't show on the 14th. This is documented in https://fullcalendar.io/docs/event-object in the section about the "end" property. If you remove `allDay:true` then it works as you want it to. Demo: http://jsfiddle.net/qfegv56L/ (the demo uses fullcalendar 3, but this rule is the same in v3 and v4) – ADyson Mar 28 '19 at 23:43
  • Yes you are correct. I was sure I tested with both allDay 'true' and 'false'. But when I tried it now it fixed my problem. Thank you very much @ADyson I appreciate your time spent finding this out! – Terje Nesthus Mar 30 '19 at 00:14

0 Answers0