minMaxTimePlugin.min.js 6.3 KB

12345678
  1. /**
  2. * Minified by jsDelivr using Terser v5.3.5.
  3. * Original file: /npm/flatpickr@4.6.9/dist/plugins/minMaxTimePlugin.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(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).minMaxTimePlugin=t()}(this,(function(){"use strict";var e=function(e,t){return void 0===t&&(t=2),("000"+e).slice(-1*t)},t=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},n={Z:function(e){return e.toISOString()},D:function(e,t,i){return t.weekdays.shorthand[n.w(e,t,i)]},F:function(e,i,o){return t(n.n(e,i,o)-1,!1,i)},G:function(t,i,o){return e(n.h(t,i,o))},H:function(t){return e(t.getHours())},J:function(e,t){return void 0!==t.ordinal?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[(n=e.getHours()>11,!0===n?1:0)];var n},M:function(e,n){return t(e.getMonth(),!0,n)},S:function(t){return e(t.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(t){return e(t.getFullYear(),4)},d:function(t){return e(t.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(t){return e(t.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(t){return e(t.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},i={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(e){return"undefined"!=typeof console&&console.warn(e)},getWeek:function(e){var t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var n=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-n.getTime())/864e5-3+(n.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},o={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},r=function(e){var t=e.config,r=void 0===t?i:t,a=e.l10n,u=void 0===a?o:a,s=e.isMobile,g=void 0!==s&&s;return function(e,t,i){var o=i||u;return void 0===r.formatDate||g?t.split("").map((function(t,i,a){return n[t]&&"\\"!==a[i-1]?n[t](e,o,r):"\\"!==t?t:""})).join(""):r.formatDate(e,t,o)}};function a(e,t,n){return void 0===n&&(n=!0),!1!==n?new Date(e.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):e.getTime()-t.getTime()}function u(e,t){return 3600*(e.getHours()-t.getHours())+60*(e.getMinutes()-t.getMinutes())+e.getSeconds()-t.getSeconds()}return function(e){void 0===e&&(e={});var t={formatDate:r({}),tableDateFormat:e.tableDateFormat||"Y-m-d",defaults:{minTime:void 0,maxTime:void 0}};return function(n){return{onReady:function(){t.formatDate=this.formatDate,t.defaults={minTime:this.config.minTime&&t.formatDate(this.config.minTime,"H:i"),maxTime:this.config.maxTime&&t.formatDate(this.config.maxTime,"H:i")},n.loadedPlugins.push("minMaxTime")},onChange:function(){var i,o=this.latestSelectedDateObj,r=o&&(i=o,void 0!==e.table?e.table[t.formatDate(i,t.tableDateFormat)]:e.getTimeLimits&&e.getTimeLimits(i));if(o&&void 0!==r)this.set(r),n.config.minTime.setFullYear(o.getFullYear()),n.config.maxTime.setFullYear(o.getFullYear()),n.config.minTime.setMonth(o.getMonth()),n.config.maxTime.setMonth(o.getMonth()),n.config.minTime.setDate(o.getDate()),n.config.maxTime.setDate(o.getDate()),a(o,n.config.maxTime,!1)>0?n.setDate(new Date(o.getTime()).setHours(n.config.maxTime.getHours(),n.config.maxTime.getMinutes(),n.config.maxTime.getSeconds(),n.config.maxTime.getMilliseconds()),!1):a(o,n.config.minTime,!1)<0&&n.setDate(new Date(o.getTime()).setHours(n.config.minTime.getHours(),n.config.minTime.getMinutes(),n.config.minTime.getSeconds(),n.config.minTime.getMilliseconds()),!1);else{var s=t.defaults||{minTime:void 0,maxTime:void 0};if(this.set(s),!o)return;var g=n.config,m=g.minTime,l=g.maxTime;m&&u(o,m)<0?n.setDate(new Date(o.getTime()).setHours(m.getHours(),m.getMinutes(),m.getSeconds(),m.getMilliseconds()),!1):l&&u(o,l)>0&&n.setDate(new Date(o.getTime()).setHours(l.getHours(),l.getMinutes(),l.getSeconds(),l.getMilliseconds()))}}}}}}));
  8. //# sourceMappingURL=/sm/93884424c0cabcd1dd63ec2a7a579365c03ee622b71646543501b31aadf29e31.map