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
F14055617: D16879.diff
Sat, Nov 16, 1:51 PM
F14042186: D16879.diff
Tue, Nov 12, 1:12 AM
F14026321: D16879.diff
Fri, Nov 8, 12:59 AM
F13991240: D16879.id40638.diff
Tue, Oct 22, 9:28 AM
F13991239: D16879.id40636.diff
Tue, Oct 22, 9:27 AM
F13991238: D16879.id.diff
Tue, Oct 22, 9:27 AM
F13991166: D16879.diff
Tue, Oct 22, 9:04 AM
F13971701: D16879.diff
Oct 17 2024, 2:51 PM
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.