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
F14087110: D16653.diff
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
Unknown Object (File)
Sun, Nov 3, 12:45 PM
Unknown Object (File)
Oct 22 2024, 5:13 PM
Unknown Object (File)
Oct 20 2024, 10:52 PM
Unknown Object (File)
Oct 17 2024, 8:25 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 14002
Build 18150: Run Core Tests
Build 18149: 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.