Homec4science

Parse ICS datetimes and durations

Authored by epriestley <git@epriestley.com> on Sep 13 2016, 20:38.

Description

Parse ICS datetimes and durations

Summary:
Ref T10747. This parses "SUMMARY" and "DESCRIPTION" from ICS (easy) and "DTSTART", "DTEND" and "DURATION" (big mess, as one might reasonably expect).

ICS dates can be absolute (e.g., at a specific time in history) or "floating". If an event is "floating", it has a date like "June 23 at 5PM", which is expected to be interpreted according to the viewer timezone, i.e. occur at different times in different timezones.

Dates can also be "start + end" or "start + duration". Worse, they can be a floating start plus a duration. Do a bunch of gymnastics to represent all this stuff faithfully.

This probably still doesn't handle all-day events properly, but I'll deal with them in the future.

Test Plan: Added unit tests; ran unit tests.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10747

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

Details

Committed
epriestley <git@epriestley.com>Sep 14 2016, 21:19
Pushed
aubortMar 17 2017, 12:03
Parents
rPHUf8af794b2135: Make error handling for ICS parsing more robust
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHUf241706ade25: Parse ICS datetimes and durations (authored by epriestley <git@epriestley.com>).Sep 14 2016, 21:19