Page MenuHomePhabricator

Parse ICS datetimes and durations
ClosedPublic

Authored by epriestley on Sep 13 2016, 7:50 PM.
Tags
None
Referenced Files
F18613322: D16548.diff
Sun, Sep 14, 10:59 AM
F18601073: D16548.id39831.diff
Sat, Sep 13, 11:26 AM
F18508085: D16548.id.diff
Fri, Sep 5, 2:36 AM
F17867542: D16548.id.diff
Jul 28 2025, 6:19 AM
F17856106: D16548.diff
Jul 27 2025, 4:55 PM
F17740939: D16548.id.diff
Jul 21 2025, 7:43 AM
F17730722: D16548.diff
Jul 19 2025, 11:05 PM
F17654796: D16548.diff
Jul 12 2025, 9:15 AM
Subscribers
None

Details

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.

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Parse ICS datetimes and durations.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
chad edited edge metadata.
This revision is now accepted and ready to land.Sep 13 2016, 8:21 PM
This revision was automatically updated to reflect the committed changes.