diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index 27573e7..c21c28d 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -651,7 +651,36 @@ function template_preprocess_links(&$variables) {
       );
       // Convert the attributes array into an Attribute object.
       $heading['attributes'] = new Attribute($heading['attributes']);
-      $heading['text'] = String::checkPlain($heading['text']);
+	  +
+	/**
+	 * Returns HTML for an #month form element.
+	 *
+	 * Supports HTML5 types of 'date', 'datetime', 'datetime-local', and 'time'.
+	 * Falls back to a plain textfield. Used as a sub-element by the datetime
+	 * element type.
+	 *
+	 * @param array $variables
+	 * An associative array containing:
+	 * - element: An associative array containing the properties of the element.
+	 * Properties used: #title, #value, #options, #description, #required,
+	 * #attributes, #id, #name, #type, #min, #max, #step, #value, #size.
+	 *
+	 * @return string
+	 * String form element.
+	 *
+	 * @ingroup themeable
+	 */
+	function theme_month($variables) {
+	 $element = $variables['element'];
+	 if (empty($element['attribute']['type'])) {
+	 $element['attribute']['type'] = 'date';
+	 }
+	 element_set_attributes($element, array('id', 'name', 'type', 'min', 'max', 'step', 'value', 'size'));
+	 _form_set_attributes($element, array('form-' . $element['attribute']['type']));
+		
+	 return '<input' . new Attribute($element['#attributes']) . ' />';
+	 }
+     $heading['text'] = String::checkPlain($heading['text']);
     }
 
     $variables['links'] = array();
@@ -1623,9 +1652,15 @@ function template_preprocess_field(&$variables, $hook) {
 
   // Creating variables for the template.
   $variables['entity_type'] = $element['#entity_type'];
-  $variables['field_name'] = $element['#field_name'];
-  $variables['field_type'] = $element['#field_type'];
+  $variables['field_name'] = strtr($element['#field_name'], '_', '-');
+  $variables['field_type'] = strtr($element['#field_type'], '_', '-');
+  $variables['field_label'] = strtr($element['#label_display'], '_', '-');
   $variables['label_display'] = $element['#label_display'];
+   // Are there multiple field items.
+		 $variables['multiple'] = FALSE;
+		 if (isset($element['#items']) && is_callable($element['#items']->getFieldDefinition(), 'isMultiple')) {
+		 $variables['multiple'] = $element['#items']->getFieldDefinition()->isMultiple();
+		}
 
   $variables['label_hidden'] = ($element['#label_display'] == 'hidden');
   // Always set the field label - allow themes to decide whether to display it.
@@ -1637,6 +1672,18 @@ function template_preprocess_field(&$variables, $hook) {
   if (!isset($default_attributes)) {
     $default_attributes = new Attribute;
   }
+  // Merge the attributes when its a multiple fields with hidden label
+		if ($element['#label_display'] == 'hidden' && $variables['multiple']) {
+		$variables['attributes'] = NestedArray::mergeDeep($variables['attributes'], $variables['content_attributes']);
+		 }
+		 // Merge the attributes when its a single field with a label
+		 if ($element['#label_display'] != 'hidden' && !$variables['multiple']) {
+		 $variables['content_attributes'] = NestedArray::mergeDeep($variables['content_attributes'], (array) $element['#items'][0]->_attributes);
+		 }
+		 // Merge the attributes when its a single field with hidden label
+		 if ($element['#label_display'] == 'hidden' && !$variables['multiple']) {
+		 $variables['attributes'] = NestedArray::mergeDeep($variables['attributes'], $variables['content_attributes'], (array) $element['#items'][0]->_attributes);
+		 }
 
   // We want other preprocess functions and the theme implementation to have
   // fast access to the field item render arrays. The item render array keys
diff --git a/core/modules/system/src/Tests/Form/FormTest.php b/core/modules/system/src/Tests/Form/FormTest.php
index 22b3b84..62889ed 100644
--- a/core/modules/system/src/Tests/Form/FormTest.php
+++ b/core/modules/system/src/Tests/Form/FormTest.php
@@ -55,7 +55,8 @@ function testRequiredFields() {
     $empty_strings = array('""' => "", '"\n"' => "\n", '" "' => " ", '"\t"' => "\t", '" \n\t "' => " \n\t ", '"\n\n\n\n\n"' => "\n\n\n\n\n");
     $empty_arrays = array('array()' => array());
     $empty_checkbox = array(NULL);
-
+	$elements['month']['element'] = array('#title' => $this->randomName(), '#type' => 'month');
+    $elements['month']['empty_values'] = $empty_strings;
     $elements['textfield']['element'] = array('#title' => $this->randomMachineName(), '#type' => 'textfield');
     $elements['textfield']['empty_values'] = $empty_strings;
 
