X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fdatetime%2Fsrc%2FPlugin%2FField%2FFieldFormatter%2FDateTimePlainFormatter.php;h=7f0dee2c31dda8d7d2ce335379fbb39f608df8b0;hp=d35d3801da56b24f560cef656643705789e476d8;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/web/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimePlainFormatter.php b/web/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimePlainFormatter.php index d35d3801d..7f0dee2c3 100644 --- a/web/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimePlainFormatter.php +++ b/web/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimePlainFormatter.php @@ -25,27 +25,12 @@ class DateTimePlainFormatter extends DateTimeFormatterBase { $elements = []; foreach ($items as $delta => $item) { - $output = ''; if (!empty($item->date)) { /** @var \Drupal\Core\Datetime\DrupalDateTime $date */ $date = $item->date; - if ($this->getFieldSetting('datetime_type') == 'date') { - // A date without time will pick up the current time, use the default. - datetime_date_default_time($date); - } - $this->setTimeZone($date); - - $output = $this->formatDate($date); + $elements[$delta] = $this->buildDate($date); } - $elements[$delta] = [ - '#cache' => [ - 'contexts' => [ - 'timezone', - ], - ], - '#markup' => $output, - ]; } return $elements;