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
Unknown Object (File)
Sun, Dec 22, 12:34 AM
Unknown Object (File)
Sun, Dec 22, 12:34 AM
Unknown Object (File)
Sun, Dec 22, 12:34 AM
Unknown Object (File)
Sun, Dec 22, 12:34 AM
Unknown Object (File)
Sun, Dec 22, 12:34 AM
Unknown Object (File)
Sun, Dec 22, 12:27 AM
Unknown Object (File)
Thu, Dec 12, 5:30 AM
Unknown Object (File)
Sat, Dec 7, 6:12 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.