diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 248c795..9e57ebe 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1036,7 +1036,9 @@ function theme_disable($theme_list) { */ /** - * Preprocess variables for theme_datetime(). + * Prepares variables for time templates. + * + * Default template: time.html.twig. * * @param array $variables * An associative array possibly containing: @@ -1044,7 +1046,7 @@ function theme_disable($theme_list) { * - timestamp: * - text: */ -function template_preprocess_datetime(&$variables) { +function template_preprocess_time(&$variables) { // Format the 'datetime' attribute based on the timestamp. // @see http://www.w3.org/TR/html5-author/the-time-element.html#attr-time-datetime if (!isset($variables['attributes']['datetime']) && isset($variables['timestamp'])) { @@ -2537,9 +2539,9 @@ function drupal_common_theme() { 'render element' => 'elements', 'template' => 'region', ), - 'datetime' => array( + 'time' => array( 'variables' => array('timestamp' => NULL, 'text' => NULL, 'attributes' => array(), 'html' => FALSE), - 'template' => 'datetime', + 'template' => 'time', ), 'status_messages' => array( 'variables' => array('display' => NULL), diff --git a/core/modules/aggregator/aggregator.theme.inc b/core/modules/aggregator/aggregator.theme.inc index 9282b78..e46ffc5 100644 --- a/core/modules/aggregator/aggregator.theme.inc +++ b/core/modules/aggregator/aggregator.theme.inc @@ -118,7 +118,7 @@ function template_preprocess_aggregator_summary_item(&$variables) { $variables['age'] = array( '#theme' => 'datetime', '#attributes' => array( - 'datetime' => format_date($item->getPostedTime(), 'html_datetime', '', 'UTC'), + 'time' => format_date($item->getPostedTime(), 'html_datetime', '', 'UTC'), 'class' => array('feed-item-age',), ), '#text' => t('%age old', array('%age' => \Drupal::service('date')->formatInterval(REQUEST_TIME - $item->getPostedTime()))), diff --git a/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeDefaultFormatter.php b/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeDefaultFormatter.php index c282db6..dadac84 100644 --- a/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeDefaultFormatter.php +++ b/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeDefaultFormatter.php @@ -126,7 +126,7 @@ public function viewElements(FieldItemListInterface $items) { // Display the date using theme datetime. $elements[$delta] = array( - '#theme' => 'datetime', + '#theme' => 'time', '#text' => $formatted_date, '#html' => FALSE, '#attributes' => array( diff --git a/core/modules/system/templates/datetime.html.twig b/core/modules/system/templates/datetime.html.twig deleted file mode 100644 index 183b834..0000000 --- a/core/modules/system/templates/datetime.html.twig +++ /dev/null @@ -1,28 +0,0 @@ -{# -/** - * @file - * Default theme implementation for a date / time element. - * - * Available variables - * - timestamp: (optional) A UNIX timestamp for the datetime attribute. If the - * datetime cannot be represented as a UNIX timestamp, use a valid datetime - * attribute value in attributes.datetime. - * - text: (optional) The content to display within the