tethys/public/backend/tinyDatePicker.js

1 line
11 KiB
JavaScript
Raw Normal View History

!function(t){var e={};function n(a){if(e[a])return e[a].exports;var o=e[a]={i:a,l:!1,exports:{}};return t[a].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,a){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(a,o,function(e){return t[e]}.bind(null,o));return a},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=107)}({107:function(t,e,n){t.exports=n(108)},108:function(t,e,n){"use strict";n.r(e);var a=n(57);n.n(a)()(document.querySelector("input[name='time_absolut']"))},57:function(t,e,n){t.exports=function(){"use strict";function t(){var t=new Date;return t.setHours(0,0,0,0),t}function e(t,e){return(t&&t.toDateString())===(e&&e.toDateString())}function n(t,e,n){var a=(t=new Date(t)).getDate(),o=t.getMonth()+e;return t.setDate(1),t.setMonth(n?(12+o)%12:o),t.setDate(a),t.getDate()<a&&t.setDate(0),t}function a(t,e){return(t=new Date(t)).setFullYear(t.getFullYear()+e),t}function o(t){return function(e){return function(t){return(t=new Date(t)).setHours(0,0,0,0),t}("string"==typeof e?t(e):e)}}function r(t,e,n){return t<e?e:t>n?n:t}function i(t,e){var n=void 0;return function(){clearTimeout(n),n=setTimeout(e,t)}}function u(){}function s(){for(var t=arguments,e=t[0],n=1;n<t.length;++n){var a=t[n]||{};for(var o in a)e[o]=a[o]}return e}var c={days:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],today:"Today",clear:"Clear",close:"Close"};function d(e){e=e||{};var n=o((e=s({lang:c,mode:"dp-modal",hilightedDate:t(),format:function(t){return t.getMonth()+1+"/"+t.getDate()+"/"+t.getFullYear()},parse:function(e){var n=new Date(e);return isNaN(n)?t():n},dateClass:function(){},inRange:function(){return!0}},e)).parse);return e.lang=s(c,e.lang),e.parse=n,e.inRange=function(t){var e=t.inRange;return function(n,a){return e(n,a)&&t.min<=n&&t.max>=n}}(e),e.min=n(e.min||a(t(),-100)),e.max=n(e.max||a(t(),100)),e.hilightedDate=e.parse(e.hilightedDate),e}var l={left:37,up:38,right:39,down:40,enter:13,esc:27};function f(t,e,n){return e.addEventListener(t,n,!0),function(){e.removeEventListener(t,n,!0)}}var p=function(){var t=window.CustomEvent;return"function"!=typeof t&&((t=function(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}).prototype=window.Event.prototype),t}(),h={day:{onKeyDown:function(t,e){var n,a,o=t.keyCode,r=o===l.left?-1:o===l.right?1:o===l.up?-7:o===l.down?7:0;o===l.esc?e.close():r&&(t.preventDefault(),e.setState({hilightedDate:(n=e.state.hilightedDate,a=r,(n=new Date(n)).setDate(n.getDate()+a),n)}))},onClick:{"dp-day":function(t,e){e.setState({selectedDate:new Date(parseInt(t.target.getAttribute("data-date")))})},"dp-next":function(t,e){var a=e.state.hilightedDate;e.setState({hilightedDate:n(a,1)})},"dp-prev":function(t,e){var a=e.state.hilightedDate;e.setState({hilightedDate:n(a,-1)})},"dp-today":function(e,n){n.setState({selectedDate:t()})},"dp-clear":function(t,e){e.setState({selectedDate:null})},"dp-close":function(t,e){e.close()},"dp-cal-month":function(t,e){e.setState({view:"month"})},"dp-cal-year":function(t,e){e.setState({view:"year"})}},render:function(n){var a=n.opts,o=a.lang,r=n.state,i=o.days,u=a.dayOffset||0,s=r.selectedDate,c=r.hilightedDate,d=c.getMonth(),l=t().getTime();return'<div class="dp-cal"><header class="dp-cal-header"><button tabindex="-1" type="button" class="dp-prev">Prev</button><button tabindex="-1" ty