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
F19303162: D16653.id40088.diff
Tue, Dec 23, 7:14 PM
F19255461: D16653.id40111.diff
Mon, Dec 22, 12:01 PM
F19253162: D16653.diff
Mon, Dec 22, 10:48 AM
F18980890: D16653.diff
Nov 17 2025, 1:32 AM
F18863720: D16653.id40088.diff
Nov 3 2025, 12:50 AM
F18810690: D16653.id40143.diff
Oct 19 2025, 10:54 PM
F18780573: D16653.id.diff
Oct 12 2025, 5:30 PM
F18770120: D16653.diff
Oct 8 2025, 10:53 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 14032
Build 18204: Run Core Tests
Build 18203: 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.