Page MenuHomePhabricator

Show more of UTC offset when user's TZ is not an integer number of hours offset

Authored by amckinley on Dec 12 2018, 9:20 PM.



See The code has always worked correctly, but the resulting timezone mismatch warning messsage wasn't specific enough when the mismatch is by a non-integer number of hours.

Test Plan

Set timezone locally to Asia/Vladivostok and in Phabricator to Australia/Adelaide (which as of today's date are 30 minutes apart) and observed a more precise error message: F6061330

Diff Detail

rP Phabricator
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

amckinley created this revision.Dec 12 2018, 9:20 PM
amckinley requested review of this revision.Dec 12 2018, 9:21 PM
epriestley accepted this revision.Dec 12 2018, 9:47 PM

I didn't know about %+, neat.


Maybe this should be %+0.2f since 3h 15m will render as 3.2 or 3.3 right now.

Or maybe (something like) %+d:%02d with the remainder, so we get +3:15, +3:30 and +3:45 instead of +3.25, +3.5 and +3.75 -- that seems marginally clearer?

This revision is now accepted and ready to land.Dec 12 2018, 9:47 PM
amckinley updated this revision to Diff 47459.Dec 12 2018, 10:00 PM

Change format string to match "hours:minutes", rename variables for clarity.

New appearance:

amckinley updated this revision to Diff 47460.Dec 12 2018, 10:02 PM

Repeated code.

This revision was automatically updated to reflect the committed changes.
amckinley marked an inline comment as done.Dec 12 2018, 10:02 PM