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

Render timezone names more readably, with spaces rather than underscores ("America/Los Angeles", not "America/Los_Angeles").

Summary:
See downstream <https://phabricator.wikimedia.org/T902>. Currently, timezones are rendered with their raw internal names (like `America/Los_Angeles`) which include underscores.

Replacing underscores with spaces is a more human-readable (and perhaps meaningfully better for things like screen readers, although this is pure speculation).

There's some vague argument against this, like "administrators may need to set a raw internal value in `phabricator.timezone` and this could mislead them", but we already give a pretty good error message if you do this and could improve hinting if necessary.

Test Plan: Viewed timezone list in {nav Settings} and the timezone "reconcile" dialog, saw a more-readable "Los Angeles".

Reviewers: amckinley

Reviewed By: amckinley

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

+20 -2
+2 -1
src/applications/settings/controller/PhabricatorSettingsTimezoneController.php
··· 20 20 $zone = new DateTimeZone($identifier); 21 21 $offset = -($zone->getOffset($now) / 60); 22 22 if ($offset == $client_offset) { 23 - $options[$identifier] = $identifier; 23 + $name = PhabricatorTime::getTimezoneDisplayName($identifier); 24 + $options[$identifier] = $name; 24 25 } 25 26 } 26 27
+8 -1
src/applications/settings/setting/PhabricatorTimezoneSetting.php
··· 81 81 } 82 82 83 83 sort($group); 84 + 85 + $group_map = array(); 86 + foreach ($group as $identifier) { 87 + $name = PhabricatorTime::getTimezoneDisplayName($identifier); 88 + $group_map[$identifier] = $name; 89 + } 90 + 84 91 $option_groups[] = array( 85 92 'label' => $label, 86 - 'options' => array_fuse($group), 93 + 'options' => $group_map, 87 94 ); 88 95 } 89 96
+10
src/infrastructure/time/PhabricatorTime.php
··· 78 78 return $datetime; 79 79 } 80 80 81 + public static function getTimezoneDisplayName($raw_identifier) { 82 + 83 + // Internal identifiers have names like "America/Los_Angeles", but this is 84 + // just an implementation detail and we can render them in a more human 85 + // readable format with spaces. 86 + $name = str_replace('_', ' ', $raw_identifier); 87 + 88 + return $name; 89 + } 90 + 81 91 }