Homec4science

Store "All Day" events in a way that is compatible with EditEngine

Authored by epriestley <git@epriestley.com> on Jul 15 2016, 19:10.

Description

Store "All Day" events in a way that is compatible with EditEngine

Summary:
Ref T11326. Normally, events occur at a specific epoch, independent of the viewer. For example, if we're having a meeting in 35 hours, every user who looks at the event will see that it starts 35 hours from now.

But when an event is "All Day", the start time and end time depend on the viewer. A day like "Christmas" does not start at the same time for everyone: it starts sooner if you're in a more-eastern timezone. Baiscally, an event on "July 15th" starts whenever "July 15th" starts for whoever is looking at it.

Previously, we stored these events by using the western-most and eastern-most timezones as the start and end times (the earliest possible start and latest possible end).

This worked OK, but we get into a bunch of trouble with EditEngine, mostly because each field can be updated individually now. We can't easily tell if an event is all-day or not when reading or updating the start time and end time, and making that easier would introduce a huge amount of complexity.

Instead, when we update the start or end time, we write two times:

  • The epoch timestamp of the time the user entered, which is the start time we will use if the event is a normal event.
  • The epoch timestamp of 12:00 AM in UTC on the same date as the local date the user entered. This is pretty much like just storing the date the user actually typed. This is what w'ell use if the event is an all-day event.

Then, no matter whether the event is later made all-day or not, we have all the information we need to display it correctly.

Test Plan:

  • Created and edited all-day events.
  • Migrated existing all-day events, which appeared to survive without problems. (Note that events all-day which were created or edited in the last couple of days master won't survive this mutation correctly and will need to be fixed.)
  • Created and edited normal, recurring, and recurring all-day events.
  • Swapped back to stable, created an event, specifically migrated it forward, made sure it survived with times intact.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11326

Differential Revision: https://secure.phabricator.com/D16305

Details

Committed
epriestley <git@epriestley.com>Jul 15 2016, 21:24
Pushed
aubortJan 31 2017, 17:16
Parents
rPHcf57f6385ba1: Fix some Calendar Event userPHID/hostPHID/"Creator" confusion in searching
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHe2b6912b9dc7: Store "All Day" events in a way that is compatible with EditEngine (authored by epriestley <git@epriestley.com>).Jul 15 2016, 21:24