diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 015b517d51b80ea86b26ab3716e3d74458246161..08ad960625626e9baa20237f594395f7ebaa80f5 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -826,7 +826,9 @@ function drupal_render_inline_template(&$element) { */ /** - * Preprocess variables for theme_datetime(). + * Prepares variables for time templates. + * + * Default template: time.html.twig. * * @param array $variables * An associative array possibly containing: @@ -834,7 +836,7 @@ function drupal_render_inline_template(&$element) { * - 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'])) { @@ -2350,9 +2352,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 1335ee61b8efd6636e9f50b074c8d4c3e5d61d30..605025c10b75f78bd24d8788eae530a6915f423a 100644 --- a/core/modules/aggregator/aggregator.theme.inc +++ b/core/modules/aggregator/aggregator.theme.inc @@ -116,7 +116,7 @@ function template_preprocess_aggregator_summary_item(&$variables) { ), )); $variables['age'] = array( - '#theme' => 'datetime', + '#theme' => 'time', '#attributes' => array( 'datetime' => format_date($item->getPostedTime(), 'html_datetime', '', 'UTC'), 'class' => array('feed-item-age',), diff --git a/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeDefaultFormatter.php b/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeDefaultFormatter.php index 65167b34178f5a6d0f41de1af2343ff0ecd54d53..f983c8d8fa6e7bb72878f47e075828acae6ddb34 100644 --- a/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeDefaultFormatter.php +++ b/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeDefaultFormatter.php @@ -127,7 +127,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/time.html.twig similarity index 100% rename from core/modules/system/templates/datetime.html.twig rename to core/modules/system/templates/time.html.twig