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
F18872691: D16879.id40638.diff
Nov 5 2025, 5:45 AM
F18818518: D16879.id.diff
Oct 22 2025, 12:41 AM
F18812801: D16879.diff
Oct 20 2025, 12:29 PM
F18759888: D16879.id.diff
Oct 6 2025, 6:31 AM
F18702106: D16879.diff
Sep 27 2025, 10:37 PM
F18655438: D16879.id40636.diff
Sep 22 2025, 7:59 PM
F18626049: D16879.diff
Sep 16 2025, 12:14 AM
F18625609: D16879.diff
Sep 15 2025, 11:08 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.