Page MenuHomePhabricator

Fix an issue where All Day events could return a DateTime with the wrong timezone
ClosedPublic

Authored by epriestley on Nov 16 2016, 3:24 PM.
Tags
None
Referenced Files
F13238151: D16879.id40636.diff
Tue, May 21, 5:23 PM
F13238014: D16879.id.diff
Tue, May 21, 4:33 PM
F13229045: D16879.id.diff
Mon, May 20, 1:59 PM
F13225322: D16879.diff
Sun, May 19, 2:38 PM
F13195431: D16879.diff
Sun, May 12, 10:23 PM
F13177776: D16879.diff
Wed, May 8, 7:57 PM
Unknown Object (File)
Wed, May 1, 7:44 PM
Unknown Object (File)
Wed, May 1, 12:34 AM
Subscribers
None

Details

Summary

Ref T11816. When building a PHP DateTime object, we favored the DateTime's timezone over the viewer's timezone, even for all-day dates.

This is incorrect: we should return all-day dates in the viewer's timezone, since otherwise the display layer will adjust them to the "correct" timezone.

Now non-all-day dates retain the old logic; all-day dates favor the viewer's timezone.

This only meaningfully affected display stuff since all the epoch logic was already correct.

Test Plan

Created an all day event, changed timezone forward/backward, observed dates still rendering correctly in tooltips and subheaders.

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Fix an issue where All Day events could return a DateTime with the wrong timezone.
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.Nov 16 2016, 3:30 PM
This revision was automatically updated to reflect the committed changes.