Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14083857
D20314.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D20314.diff
View Options
diff --git a/src/applications/settings/controller/PhabricatorSettingsTimezoneController.php b/src/applications/settings/controller/PhabricatorSettingsTimezoneController.php
--- a/src/applications/settings/controller/PhabricatorSettingsTimezoneController.php
+++ b/src/applications/settings/controller/PhabricatorSettingsTimezoneController.php
@@ -113,6 +113,11 @@
}
private function formatOffset($offset) {
+ // This controller works with client-side (Javascript) offsets, which have
+ // the opposite sign we might expect -- for example "UTC-3" is a positive
+ // offset. Invert the sign before rendering the offset.
+ $offset = -1 * $offset;
+
$hours = $offset / 60;
// Non-integer number of hours off UTC?
if ($offset % 60) {
diff --git a/src/applications/settings/setting/PhabricatorTimezoneSetting.php b/src/applications/settings/setting/PhabricatorTimezoneSetting.php
--- a/src/applications/settings/setting/PhabricatorTimezoneSetting.php
+++ b/src/applications/settings/setting/PhabricatorTimezoneSetting.php
@@ -57,11 +57,11 @@
$groups = array();
foreach ($timezones as $timezone) {
$zone = new DateTimeZone($timezone);
- $offset = -($zone->getOffset($now) / (60 * 60));
+ $offset = ($zone->getOffset($now) / 60);
$groups[$offset][] = $timezone;
}
- krsort($groups);
+ ksort($groups);
$option_groups = array(
array(
@@ -71,10 +71,13 @@
);
foreach ($groups as $offset => $group) {
- if ($offset >= 0) {
- $label = pht('UTC-%d', $offset);
+ $hours = $offset / 60;
+ $minutes = abs($offset % 60);
+
+ if ($offset % 60) {
+ $label = pht('UTC%+d:%02d', $hours, $minutes);
} else {
- $label = pht('UTC+%d', -$offset);
+ $label = pht('UTC%+d', $hours);
}
sort($group);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 5:44 AM (18 h, 55 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6781385
Default Alt Text
D20314.diff (1 KB)
Attached To
Mode
D20314: Fix two minor timezone display issues
Attached
Detach File
Event Timeline
Log In to Comment