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
F19816520: D16879.id40638.diff
Mar 5 2026, 6:18 AM
F19768462: D16879.id40638.diff
Feb 19 2026, 6:18 PM
F19661134: D16879.diff
Feb 7 2026, 5:48 AM
F19578132: D16879.id40636.diff
Feb 1 2026, 12:09 PM
F19522340: D16879.diff
Jan 17 2026, 6:32 AM
F19517013: D16879.diff
Jan 15 2026, 6:36 AM
F19514967: D16879.diff
Jan 14 2026, 6:47 AM
F19399312: D16879.diff
Dec 27 2025, 11:57 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
Branch
vzone1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 14524
Build 18942: Run Core Tests
Build 18941: arc lint + arc unit

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.