'#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) {
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]);