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
F18399728: D16653.id40111.diff
Fri, Aug 29, 4:55 PM
F18200203: D16653.id40141.diff
Mon, Aug 18, 4:37 AM
F18200202: D16653.id40088.diff
Mon, Aug 18, 4:37 AM
F18200201: D16653.id40111.diff
Mon, Aug 18, 4:37 AM
F18200199: D16653.id40112.diff
Mon, Aug 18, 4:37 AM
F18097757: D16653.id40112.diff
Fri, Aug 8, 3:25 PM
F18093699: D16653.id40141.diff
Thu, Aug 7, 8:04 PM
F18093617: D16653.id40088.diff
Thu, Aug 7, 7:37 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.