Move all files to 2017/
This commit is contained in:
parent
ac7370f67f
commit
2875863330
15717 changed files with 0 additions and 0 deletions
38
2017/web/core/misc/date.js
Normal file
38
2017/web/core/misc/date.js
Normal file
|
@ -0,0 +1,38 @@
|
|||
/**
|
||||
* DO NOT EDIT THIS FILE.
|
||||
* See the following change record for more information,
|
||||
* https://www.drupal.org/node/2815083
|
||||
* @preserve
|
||||
**/
|
||||
|
||||
(function ($, Modernizr, Drupal) {
|
||||
Drupal.behaviors.date = {
|
||||
attach: function attach(context, settings) {
|
||||
var $context = $(context);
|
||||
|
||||
if (Modernizr.inputtypes.date === true) {
|
||||
return;
|
||||
}
|
||||
$context.find('input[data-drupal-date-format]').once('datePicker').each(function () {
|
||||
var $input = $(this);
|
||||
var datepickerSettings = {};
|
||||
var dateFormat = $input.data('drupalDateFormat');
|
||||
|
||||
datepickerSettings.dateFormat = dateFormat.replace('Y', 'yy').replace('m', 'mm').replace('d', 'dd');
|
||||
|
||||
if ($input.attr('min')) {
|
||||
datepickerSettings.minDate = $input.attr('min');
|
||||
}
|
||||
if ($input.attr('max')) {
|
||||
datepickerSettings.maxDate = $input.attr('max');
|
||||
}
|
||||
$input.datepicker(datepickerSettings);
|
||||
});
|
||||
},
|
||||
detach: function detach(context, settings, trigger) {
|
||||
if (trigger === 'unload') {
|
||||
$(context).find('input[data-drupal-date-format]').findOnce('datePicker').datepicker('destroy');
|
||||
}
|
||||
}
|
||||
};
|
||||
})(jQuery, Modernizr, Drupal);
|
Reference in a new issue