1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-24 15:52:41 +01:00
phorge-phorge/src/applications/calendar
epriestley e2b6912b9d 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
2016-07-15 12:24:01 -07:00
..
__tests__ Make translation, timezone and pronoun into real settings 2016-06-02 06:29:47 -07:00
application Provide default view and edit policies in Calendar, plus "Event Host" and "Event Invitees" 2016-07-13 15:42:12 -07:00
capability Provide default view and edit policies in Calendar, plus "Event Host" and "Event Invitees" 2016-07-13 15:42:12 -07:00
command Convert Calendar to Modular Transactions 2016-07-13 07:46:33 -07:00
conduit Add calendar.event.search and calendar.event.edit 2016-07-13 10:17:46 -07:00
controller Move event host and times into event subheader 2016-07-14 07:50:20 -07:00
editor Provide default view and edit policies in Calendar, plus "Event Host" and "Event Invitees" 2016-07-13 15:42:12 -07:00
icon Provide a "PHUIFormIconSetControl" 2015-12-16 08:46:51 -08:00
mail phtize all the things 2015-05-22 21:16:39 +10:00
phid Make Calendar Event handles slightly more modern 2016-07-14 10:03:42 -07:00
policyrule Provide default view and edit policies in Calendar, plus "Event Host" and "Event Invitees" 2016-07-13 15:42:12 -07:00
query Fix some Calendar Event userPHID/hostPHID/"Creator" confusion in searching 2016-07-14 14:24:05 -07:00
remarkup Calendar event monograms, part 3. Remarkup for calendar event monograms. 2015-04-27 14:27:34 -07:00
search Rename Event "userPHID" to "hostPHID" 2016-07-13 15:39:55 -07:00
storage Store "All Day" events in a way that is compatible with EditEngine 2016-07-15 12:24:01 -07:00
util Linter fixes 2015-12-03 07:44:23 +11:00
view Rename Event "userPHID" to "hostPHID" 2016-07-13 15:39:55 -07:00
xaction Store "All Day" events in a way that is compatible with EditEngine 2016-07-15 12:24:01 -07:00