momentPlugin.min.js 1.5 KB

12345678
  1. /**
  2. * Minified by jsDelivr using Terser v5.3.5.
  3. * Original file: /npm/flatpickr@4.6.9/dist/plugins/momentPlugin.js
  4. *
  5. * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
  6. */
  7. !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).momentPlugin=e()}(this,(function(){"use strict";return function(t){var e=t.moment;return function(t){function n(n){var o=n;o.stopPropagation();var r=e(t.selectedDates[0]),i=function(t){try{return"function"==typeof t.composedPath?t.composedPath()[0]:t.target}catch(e){return t.target}}(o),a=Array.from(i.classList).filter((function(t){return t.startsWith("flatpickr-")})).map((function(t){return t.substring(10)}))[0],u=parseFloat(i.getAttribute("step"));r.add(u*o.delta,a),t.setDate(r.toDate())}return{parseDate:function(t,n){return e(t,n,!0).toDate()},formatDate:function(n,o){var r=e(n);return"string"==typeof t.config.locale&&r.locale(t.config.locale),r.format(o)},onReady:function(){[t.hourElement,t.minuteElement,t.secondElement].forEach((function(t){return t&&t.addEventListener("increment",n,{capture:!0})}))},onDestroy:function(){[t.hourElement,t.minuteElement,t.secondElement].forEach((function(t){return t&&t.removeEventListener("increment",n,{capture:!0})}))}}}}}));
  8. //# sourceMappingURL=/sm/5799d9384916bc208a311b2ee20c688f3062f2ce15ff31e2ab07cca3c2d5a7b4.map