question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

All day, multi day event is moved to wrong date on calendar

See original GitHub issue

I am having a very confusing and frustrating bug.

It happens when I create a multiple day event that is also an ‘All Day’ event. The event is sort of there for single day events, but for whatever reason, they appear unaffected in the calendar view.

JSBin is http://jsbin.com/zewegexihi/edit?js,output

The data is collected from a json feed of events where the time and date were set with a datetime picker extension for bootstrap, and then a user can click a checkbox to set an event to ‘All Day’ even if they have already set a start and end time (which explains the very specific start and end times on all day events)

‘Event 2 - Conference’ is set to be starting on October 19th, and ending on the 23rd, but the calendar displays it as ending one day too early.

I have included a console.log to output the event object being clicked, but the jsbin console is not that great, so I will include output from my local copy, which is using the exact same data:

_d: Sun Oct 18 2015 18:00:00 GMT-0600 (MDT)
_f: "YYYY-MM-DDTHH:mm:ss.SSSSZ"
_fullCalendar: true
_i: "2015-10-19T08:00:00.000-06:00"

_i is what the event was supplied with, and _d is what fullCalendar is rendering.

In every single all day event, no matter the start or end time supplied, it is always one day earlier at 18:00.

it appears that the All Day flag is setting the start and end times to 0:00:00, and then a timezone issue is pushing all those times into the previous day, but I can’t for the life of me figure out how to prevent this behaviour.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
jdhornercommented, Nov 25, 2015

So just to be clear:

start: 2015-10-25T00:00:00
end: 2015-10-26T23:59:59
allDay: true

Will ONLY show in a month view as being on the 25th. (Instead of the 25th and 26th) The solution is to instead set end: 2015-10-27T00:00:00 ? So that the 25th and 26th are included, but the 27th is not, since allDay + end works EXclusively?

0reactions
jdhornercommented, Nov 27, 2015

Your way totally makes sense. Since FC is end-exclusive, having “1 second before midnight” expect it to think it was the next day was silly, on our part. There is still one exact second until the next day. So even if it DID take time into account for allDay: true, our example wouldn’t work regardless.

In a time-exclusive environment, settings midnight on start and end + 1 day DOES make sense.

E.g. to have something be the 25th and 26th, setting end to midnight on the 27th “works”. Exclusively, “just before midnight” would be the end of the previous included day.

Once we understood the logic, it was fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create or modify all-day or multiday events in Calendar on Mac
Create an event that spans multiple consecutive days: In the all-day section of Week view, drag from the start date to the end...
Read more >
Changing the Date/Time of Multiple Events in Calendar
I would like to efficiently change the date of multiple events at once. For example, I have an event with the same tag:...
Read more >
All Day Events Span Two Days - Slipstick Systems
When your all day events span two days, it means the time zone is different from the time zone used when you created...
Read more >
How to work with all-day and multi-day events in Calendar
Double-click the all-day section for the date, enter the name of the event, and hit Return. Create All-Day Section Event in Calendar on...
Read more >
How to fix time wrong in Google Calendar - OrganicWeb
The reason that this problem occurs is that your calendar timezone setting may be incorrect. Follow the instructions below to fix this issue:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found