@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Summary: See https://discourse.phabricator-community.org/t/personal-timezone-setting-mismatch-cleared-and-more-specific-cases/1680. 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

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D19873

+7 -6
+7 -6
src/applications/settings/controller/PhabricatorSettingsTimezoneController.php
··· 63 63 64 64 $server_offset = $viewer->getTimeZoneOffset(); 65 65 66 - if ($client_offset == $server_offset || $did_calibrate) { 66 + if (($client_offset == $server_offset) || $did_calibrate) { 67 67 return $this->newDialog() 68 68 ->setTitle(pht('Timezone Calibrated')) 69 69 ->appendParagraph( ··· 113 113 } 114 114 115 115 private function formatOffset($offset) { 116 - $offset = $offset / 60; 117 - 118 - if ($offset >= 0) { 119 - return pht('UTC-%d', $offset); 116 + $hours = $offset / 60; 117 + // Non-integer number of hours off UTC? 118 + if ($offset % 60) { 119 + $minutes = abs($offset % 60); 120 + return pht('UTC%+d:%02d', $hours, $minutes); 120 121 } else { 121 - return pht('UTC+%d', -$offset); 122 + return pht('UTC%+d', $hours); 122 123 } 123 124 } 124 125