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)
Fri, May 3, 5:11 AM
Unknown Object (File)
Fri, Apr 26, 1:33 AM
Unknown Object (File)
Fri, Apr 26, 1:33 AM
Unknown Object (File)
Fri, Apr 26, 1:33 AM
Unknown Object (File)
Fri, Apr 26, 1:33 AM
Unknown Object (File)
Fri, Apr 26, 1:33 AM
Unknown Object (File)
Fri, Apr 26, 1:33 AM
Unknown Object (File)
Thu, Apr 25, 12:48 AM
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
Branch
cal3
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 14001
Build 18148: Run Core Tests
Build 18147: arc lint + arc unit

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.