X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fviews%2Fsrc%2FPlugin%2Fviews%2Ffield%2FDate.php;fp=web%2Fcore%2Fmodules%2Fviews%2Fsrc%2FPlugin%2Fviews%2Ffield%2FDate.php;h=ee38a4a6c3d077de4f7f14a65bb09c51ea046a4e;hp=37455cc783fcfcbda0bf2ef66a2a61be7ca8a000;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/web/core/modules/views/src/Plugin/views/field/Date.php b/web/core/modules/views/src/Plugin/views/field/Date.php index 37455cc78..ee38a4a6c 100644 --- a/web/core/modules/views/src/Plugin/views/field/Date.php +++ b/web/core/modules/views/src/Plugin/views/field/Date.php @@ -119,7 +119,7 @@ class Date extends FieldPluginBase { '#type' => 'select', '#title' => $this->t('Timezone'), '#description' => $this->t('Timezone to be used for date output.'), - '#options' => ['' => $this->t('- Default site/user timezone -')] + system_time_zones(FALSE), + '#options' => ['' => $this->t('- Default site/user timezone -')] + system_time_zones(FALSE, TRUE), '#default_value' => $this->options['timezone'], ]; foreach (array_merge(['custom'], array_keys($date_formats)) as $timezone_date_formats) { @@ -143,7 +143,9 @@ class Date extends FieldPluginBase { if ($value) { $timezone = !empty($this->options['timezone']) ? $this->options['timezone'] : NULL; - $time_diff = REQUEST_TIME - $value; // will be positive for a datetime in the past (ago), and negative for a datetime in the future (hence) + // Will be positive for a datetime in the past (ago), and negative for a + // datetime in the future (hence). + $time_diff = REQUEST_TIME - $value; switch ($format) { case 'raw time ago': return $this->dateFormatter->formatTimeDiffSince($value, ['granularity' => is_numeric($custom_format) ? $custom_format : 2]);