{:uriI"ãfile:///usr/local/bundle/bundler/gems/solidus-28213ce2047d/backend/app/assets/javascripts/spree/backend/datepicker.js?type=application/javascript&pipeline=self&id=1689d68b7ab16adf674e7d008d8373e7de9cb40b953ff6a00c5b02de17fe0859:ET:load_pathI"W/usr/local/bundle/bundler/gems/solidus-28213ce2047d/backend/app/assets/javascripts;T: filenameI"s/usr/local/bundle/bundler/gems/solidus-28213ce2047d/backend/app/assets/javascripts/spree/backend/datepicker.js;T: nameI"spree/backend/datepicker;T:logical_pathI"%spree/backend/datepicker.self.js;T:content_typeI"application/javascript;T: sourceI"5'use strict'; Spree.ready(function(){ flatpickr.localize({ weekdays: { shorthand: Spree.t('abbr_day_names') }, months: { longhand: Spree.t('month_names') } }); $('.datepicker').flatpickr({ allowInput: true }); // Handle range dates if ($('.date-range-filter .datepicker-from, .date-range-filter .datepicker-to').length) { // Returns a callback for flatpickr onChange event which updates the // respective range extremity flatpickr instance in order to have // the left range extremity lower or equal to the right range extremity. // This is accomplished swapping the range extremities when they are in the // wrong order. var swapDates = function($other, otherInstance, compareDates) { return function(selectedDates, dateStr, instance) { var date = instance.parseDate(dateStr); var otherDateStr = $other.val(); var otherDate = instance.parseDate(otherDateStr); if (date && otherDate && compareDates(date, otherDate)) { instance.setDate(otherDate); otherInstance.setDate(date); } } } var $left = $('.date-range-filter .datepicker-from'); var $right = $('.date-range-filter .datepicker-to'); var leftInstance = $left[0]._flatpickr; var rightInstance = $right[0]._flatpickr; var leftSwapDates = swapDates($right, rightInstance, function(date, otherDate) { return date > otherDate }) var rightSwapDates = swapDates($left, leftInstance, function(date, otherDate) { return date < otherDate }) leftInstance.config.onChange.push(leftSwapDates); rightInstance.config.onChange.push(rightSwapDates); // Execute swap dates check in order to correct possible wrong order at page // load leftSwapDates(null, $left.val(), leftInstance); } }); ;T: metadata{:dependencieso:Set: @hash} I"environment-version;TTI"environment-paths;TTI"rails-env;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"|file-digest:///usr/local/bundle/bundler/gems/solidus-28213ce2047d/backend/app/assets/javascripts/spree/backend/datepicker.js;TTF: requiredo;;}F: stubbedo;;}F: linkso;;}F: to_loado;;}F: to_linko;;}F:map{ I" version;TiI" file;TI" spree/backend/datepicker.js;TI" mappings;TI"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;TI" sources;T[I"datepicker.source.js;TI" names;T[I"x_sprockets_linecount;Ti<: charsetI" utf-8;F: digest"%åSnoxe‡R~×]P#ë¢c€% ÌdýÖ¹‰{F6QÅô: lengthi5:environment_versionI"1.0;T:dependencies_digest"%¿z«Íx«À‹öɨ`{&*’ÍT O—-ËFù‚:idI"E1689d68b7ab16adf674e7d008d8373e7de9cb40b953ff6a00c5b02de17fe0859;F