From 033451a4d2097e767de2cdb3eaaebde25838de11 Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Sat, 15 Jun 2013 12:01:09 +0200
Subject: [PATCH] Issue #2006484 followup by amateescu: Remove dependency on
 datetime from node.

---
 core/modules/datetime/datetime.module | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/core/modules/datetime/datetime.module b/core/modules/datetime/datetime.module
index 32b9df0cddcf..f5812c6e0c3b 100644
--- a/core/modules/datetime/datetime.module
+++ b/core/modules/datetime/datetime.module
@@ -387,6 +387,10 @@ function theme_datetime_wrapper($variables) {
   }
   $output .= $element['#children'];
 
+  if (!empty($element['#description'])) {
+    $output .= '<div class="description">' . $element['#description'] . '</div>';
+  }
+
   return $output;
 }
 
@@ -1133,10 +1137,12 @@ function datetime_range_years($string, $date = NULL) {
  * Implements hook_form_BASE_FORM_ID_alter() for node forms.
  */
 function datetime_form_node_form_alter(&$form, &$form_state, $form_id) {
+  $format_type = datetime_default_format_type();
+
   // Alter the 'Authored on' date to use datetime.
   $form['author']['date']['#type'] = 'datetime';
   $config = Drupal::config('system.date');
-  $format = $config->get('formats.html_date') . ' ' . $config->get('formats.html_time');
+  $format = $config->get('formats.html_date.pattern.' . $format_type) . ' ' . $config->get('formats.html_time.pattern.' . $format_type);
   $form['author']['date']['#description'] = t('Format: %format. Leave blank to use the time of form submission.', array('%format' => datetime_format_example($format)));
   unset($form['author']['date']['#maxlength']);
 }
-- 
GitLab