Page MenuHomePhabricator

Allow DateTime objects to be serialized and deserialized
ClosedPublic

Authored by epriestley on Oct 3 2016, 4:57 PM.
Tags
None
Referenced Files
F13086960: D16653.diff
Thu, Apr 25, 12:48 AM
Unknown Object (File)
Fri, Apr 19, 5:25 PM
Unknown Object (File)
Wed, Apr 17, 3:14 PM
Unknown Object (File)
Wed, Apr 17, 6:05 AM
Unknown Object (File)
Fri, Apr 12, 9:32 PM
Unknown Object (File)
Thu, Apr 11, 8:36 AM
Unknown Object (File)
Fri, Apr 5, 1:01 PM
Unknown Object (File)
Wed, Apr 3, 6:36 PM
Subscribers
None

Details

Summary

Ref T10747. I have to move CalendarEvents to use these for everything because ICS files can have events which we can't represent with an epoch (e.g., floating "4PM" events).

Also improve some timezone/floating logic when rendering to ISO8601.

Test Plan

arc unit; see next change.

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Allow DateTime objects to be serialized and deserialized.
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.Oct 3 2016, 5:39 PM
epriestley edited edge metadata.
  • Also serialize/deserialize Durations.
  • Add a newRelativeDateTime() convenience method.
  • Fix a bug where conversion to absolute datetime could lose timezone information.
  • Also expose newPHPDateTime() as public, mostly for format().
This revision was automatically updated to reflect the committed changes.