Calendar Plugin all-day events end too soon & render incorrectly

TL;DR: When using a topic for the use case of “team holiday calendar” with people logging replies in multiple time zones, the calendar displays the items ending too soon.

Reproduce:

  • Have the Calendar Plugin installed.
  • Set up a topic for a team to use as an “out of office” or “holiday” calendar. Embed the calendar in the topic’s first post as per the example.
  • Start having team members add their vacations as replies to the topic, e.g.
    [date=2020-02-05 timezone="America/New_York"] → [date=2020-02-07 timezone="America/New_York"] Awesome Vacation

Expected behavior:

  • A user with time zone set to America/Los_Angeles will see the above example on the calendar grid as occupying all day on February 5, 6, and 7, just as the event’s author does.

Actual behavior:

  • A user with time zone set to America/Los_Angeles will see the above example on the calendar grid as occupying all day on February 4, 5, and 6, while the person who created the event sees the correct February 5, 6, and 7.

Theories:

It seems that when a time is not supplied in the event entry, there is an assumed start time of 00:00 and an assumed end time of 00:00 in the time zone provided in said entry. So, in the example of the person in the Los Angeles time zone, the colleague in New York starts their February 5th-7th vacation at 21:00 (Los Angeles time) on February 4, and that vacation ends on February 6 at 21:00 Los Angeles time (February 7 at 00:00 in New York).

At the very minimum it seems that someone would imply an end time of 23:59:59 on the date provided if a time is not specified, not 00:00:00.

It also strikes me that for events without specific times provided, they should probably be rendered regardless of time zone, so they always match what the author stated regarless of the viewer.

1 Like

Hey Michael,

I recently made a change to the calendar plugin that is causing this to happen. Two site settings were added, which assist in making the calendar plugin work as a viable “team holiday calendar”.

The problem with all-day events is exactly what you described: Days begin at different times for different timezones. To cope with this, you can set these 2 settings (I believe 06:00 and 18:00 work well), so any date that has no time specified, will begin at 6:00 and end at 18:00.

Please give this a try and let me know how it works for you.

6 Likes

Cool. Since this is a site setting, to which time zone do these entries refer?

1 Like

The time zone is still the posting user’s time zone.

4 Likes

Looks great now. Thanks!

1 Like