Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / misc / date.es6.js
index 1098ce6b27b64f1866aac13012d7fc0ac9ff0772..94276f1e2302a8ec91ca8bfc1f019f6c20081216 100644 (file)
@@ -3,7 +3,7 @@
  * Polyfill for HTML5 date input.
  */
 
-(function ($, Modernizr, Drupal) {
+(function($, Modernizr, Drupal) {
   /**
    * Attach datepicker fallback on date elements.
    *
       if (Modernizr.inputtypes.date === true) {
         return;
       }
-      $context.find('input[data-drupal-date-format]').once('datePicker').each(function () {
-        const $input = $(this);
-        const datepickerSettings = {};
-        const dateFormat = $input.data('drupalDateFormat');
-        // The date format is saved in PHP style, we need to convert to jQuery
-        // datepicker.
-        datepickerSettings.dateFormat = dateFormat
-          .replace('Y', 'yy')
-          .replace('m', 'mm')
-          .replace('d', 'dd');
-        // Add min and max date if set on the input.
-        if ($input.attr('min')) {
-          datepickerSettings.minDate = $input.attr('min');
-        }
-        if ($input.attr('max')) {
-          datepickerSettings.maxDate = $input.attr('max');
-        }
-        $input.datepicker(datepickerSettings);
-      });
+      $context
+        .find('input[data-drupal-date-format]')
+        .once('datePicker')
+        .each(function() {
+          const $input = $(this);
+          const datepickerSettings = {};
+          const dateFormat = $input.data('drupalDateFormat');
+          // The date format is saved in PHP style, we need to convert to jQuery
+          // datepicker.
+          datepickerSettings.dateFormat = dateFormat
+            .replace('Y', 'yy')
+            .replace('m', 'mm')
+            .replace('d', 'dd');
+          // Add min and max date if set on the input.
+          if ($input.attr('min')) {
+            datepickerSettings.minDate = $input.attr('min');
+          }
+          if ($input.attr('max')) {
+            datepickerSettings.maxDate = $input.attr('max');
+          }
+          $input.datepicker(datepickerSettings);
+        });
     },
     detach(context, settings, trigger) {
       if (trigger === 'unload') {
-        $(context).find('input[data-drupal-date-format]').findOnce('datePicker').datepicker('destroy');
+        $(context)
+          .find('input[data-drupal-date-format]')
+          .findOnce('datePicker')
+          .datepicker('destroy');
       }
     },
   };
-}(jQuery, Modernizr, Drupal));
+})(jQuery, Modernizr, Drupal);