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
F14112148: D16653.id40141.diff
Thu, Nov 28, 12:15 AM
F14112089: D16653.id40143.diff
Thu, Nov 28, 12:03 AM
F14111560: D16653.diff
Wed, Nov 27, 10:00 PM
F14111352: D16653.diff
Wed, Nov 27, 9:09 PM
Unknown Object (File)
Sat, Nov 23, 7:12 PM
Unknown Object (File)
Sun, Nov 17, 3:16 PM
Unknown Object (File)
Sat, Nov 9, 4:20 PM
Unknown Object (File)
Sat, Nov 9, 1: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.