@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.

Do not show timezone offset notification when user setting is UTC

Summary:
Telling users with a UTC timezone setting in the user preferences twice a year (if you are in a place which has a Daylight Saving Time regime) that "Your browser timezone differs from your profile timezone", or even more than twice a year if you travel, makes no sense.

Do not show that message if the user's Timezone setting is UTC, because UTC is not bound to a location. The user does not care about the timezone offset as they chose UTC.

Prior work: rP8092d90c

Closes T16255

Test Plan:
# Make sure your browser has a timezone set which is not UTC
# As an admin, go to http://phorge.localhost/config/edit/phabricator.timezone/ and set Default Timezone to "UTC"
# As an admin, create two new users tztesting01 and tztesting02 via http://phorge.localhost/people/create/
# Log in as tztesting01, see "Your browser timezone setting differs from the timezone setting in your profile, click to reconcile." notification
# Apply patch
# Log in as tztesting02, do not see "Your browser timezone setting differs from the timezone setting in your profile, click to reconcile." notification
Bonus exercise: Try with a different default timezone (I have not).
When testing, also note that `PhabricatorTimezoneSetting::expandSettingTransaction()` clears any ignored timezone offset.

Reviewers: O1 Blessed Committers, mainframe98

Reviewed By: O1 Blessed Committers, mainframe98

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16255

Differential Revision: https://we.phorge.it/D26319

+17 -14
+17 -14
src/view/page/PhabricatorStandardPageView.php
··· 245 245 246 246 if ($user) { 247 247 if ($user->isUserActivated()) { 248 - $offset = $user->getTimeZoneOffset(); 248 + // Only bother user about timezone offset if they have not set UTC 249 + if ($user->getTimezoneIdentifier() !== 'UTC') { 250 + $offset = $user->getTimeZoneOffset(); 249 251 250 - $ignore_key = PhabricatorTimezoneIgnoreOffsetSetting::SETTINGKEY; 251 - $ignore = $user->getUserSetting($ignore_key); 252 + $ignore_key = PhabricatorTimezoneIgnoreOffsetSetting::SETTINGKEY; 253 + $ignore = $user->getUserSetting($ignore_key); 252 254 253 - Javelin::initBehavior( 254 - 'detect-timezone', 255 - array( 256 - 'offset' => $offset, 257 - 'uri' => '/settings/timezone/', 258 - 'message' => pht( 259 - 'Your browser timezone setting differs from the timezone '. 260 - 'setting in your profile, click to reconcile.'), 261 - 'ignoreKey' => $ignore_key, 262 - 'ignore' => $ignore, 263 - )); 255 + Javelin::initBehavior( 256 + 'detect-timezone', 257 + array( 258 + 'offset' => $offset, 259 + 'uri' => '/settings/timezone/', 260 + 'message' => pht( 261 + 'Your browser timezone setting differs from the timezone '. 262 + 'setting in your profile, click to reconcile.'), 263 + 'ignoreKey' => $ignore_key, 264 + 'ignore' => $ignore, 265 + )); 266 + } 264 267 265 268 if ($user->getIsAdmin()) { 266 269 $server_https = $request->isHTTPS();