Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / datetime / src / Plugin / Field / FieldFormatter / DateTimePlainFormatter.php
index 7f0dee2c31dda8d7d2ce335379fbb39f608df8b0..8ddfdda2aeb67254e038cbaf99feb62866f138af 100644 (file)
@@ -4,6 +4,7 @@ namespace Drupal\datetime\Plugin\Field\FieldFormatter;
 
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\datetime\Plugin\Field\FieldType\DateTimeItem;
+use Drupal\datetime\Plugin\Field\FieldType\DateTimeItemInterface;
 
 /**
  * Plugin implementation of the 'Plain' formatter for 'datetime' fields.
@@ -40,7 +41,7 @@ class DateTimePlainFormatter extends DateTimeFormatterBase {
    * {@inheritdoc}
    */
   protected function formatDate($date) {
-    $format = $this->getFieldSetting('datetime_type') == DateTimeItem::DATETIME_TYPE_DATE ? DATETIME_DATE_STORAGE_FORMAT : DATETIME_DATETIME_STORAGE_FORMAT;
+    $format = $this->getFieldSetting('datetime_type') == DateTimeItem::DATETIME_TYPE_DATE ? DateTimeItemInterface::DATE_STORAGE_FORMAT : DateTimeItemInterface::DATETIME_STORAGE_FORMAT;
     $timezone = $this->getSetting('timezone_override');
     return $this->dateFormatter->format($date->getTimestamp(), 'custom', $format, $timezone != '' ? $timezone : NULL);
   }