/*! * Datepicker v1.0.10 * https://fengyuanchen.github.io/datepicker * * Copyright 2014-present Chen Fengyuan * Released under the MIT license * * Date: 2020-09-29T14:46:10.983Z */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).jQuery)}(this,function(k){"use strict";function s(t,e){for(var i=0;i
',offset:10,zIndex:1e3,filter:null,show:null,hide:null,pick:null},t="undefined"!=typeof window,e=t?window:{},i=t&&"ontouchstart"in e.document.documentElement,l="datepicker",r="click.".concat(l),h="focus.".concat(l),o="hide.".concat(l),c="keyup.".concat(l),d="pick.".concat(l),a="resize.".concat(l),u="scroll.".concat(l),p="show.".concat(l),f="touchstart.".concat(l),g="".concat(l,"-hide"),y={},m=0,v=1,w=2,D=Object.prototype.toString;function b(t){return"string"==typeof t}var C=Number.isNaN||e.isNaN;function $(t){return"number"==typeof t&&!C(t)}function x(t){return void 0===t}function F(t){return"date"===(e=t,D.call(e).slice(8,-1).toLowerCase())&&!C(t.getTime());var e}function M(a,s){for(var t=arguments.length,n=new Array(2i.getFullYear(),6===d&&(c=p)),!p&&s&&(p=!1===s.call(this.$element,u,"year"));var f=n+d===h,g=f?"year picked":"year";o.push(this.createItem({picked:f,disabled:p,text:n+d,view:p?"year disabled":g,highlighted:u.getFullYear()===r}))}this.$yearsPrev.toggleClass(a,l),this.$yearsNext.toggleClass(a,c),this.$yearsCurrent.toggleClass(a,!0).html("".concat(n+-5+t," - ").concat(n+6).concat(t)),this.$years.html(o.join(""))},renderMonths:function(){for(var t=this.options,e=this.startDate,i=this.endDate,a=this.viewDate,s=t.disabledClass||"",n=t.monthsShort,r=k.isFunction(t.filter)&&t.filter,h=a.getFullYear(),a=new Date,o=a.getFullYear(),l=a.getMonth(),c=this.date.getFullYear(),d=this.date.getMonth(),u=[],p=!1,f=!1,g=0;g<=11;g+=1){var y=new Date(h,g,1),m=!1;e&&(m=(p=y.getFullYear()===e.getFullYear())&&y.getMonth()i.getMonth()),!m&&r&&(m=!1===r.call(this.$element,y,"month"));var v=h===c&&g===d,w=v?"month picked":"month";u.push(this.createItem({disabled:m,picked:v,highlighted:h===o&&y.getMonth()===l,index:g,text:n[g],view:m?"month disabled":w}))}this.$yearPrev.toggleClass(s,p),this.$yearNext.toggleClass(s,f),this.$yearCurrent.toggleClass(s,p&&f).html(h+t.yearSuffix||""),this.$months.html(u.join(""))},renderDays:function(){var t,e=this.$element,i=this.options,a=this.startDate,s=this.endDate,n=this.viewDate,r=this.date,h=i.disabledClass,o=i.filter,l=i.months,c=i.weekStart,d=i.yearSuffix,u=n.getFullYear(),p=n.getMonth(),n=new Date,f=n.getFullYear(),g=n.getMonth(),y=n.getDate(),m=r.getFullYear(),v=r.getMonth(),w=r.getDate(),k=[],D=u,b=p,n=!1;0===p?(--D,b=11):--b,t=O(D,b);var C,r=new Date(u,p,1);for((C=r.getDay()-parseInt(c,10)%7)<=0&&(C+=7),a&&(n=r.getTime()<=a.getTime()),P=t-(C-1);P<=t;P+=1){var $=new Date(D,b,P),x=!1;a&&(x=$.getTime()=s.getTime()),P=1;P<=C;P+=1){var V=new Date(M,Y,P),T=M===m&&Y===v&&P===w,I=!1;s&&(I=V.getTime()>s.getTime()),!I&&o&&(I=!1===o.call(e,V,"day")),F.push(this.createItem({disabled:I,picked:T,highlighted:M===f&&Y===g&&V.getDate()===y,muted:!0,text:P,view:"day next"}))}for(var S=[],P=1;P<=t;P+=1){var N=new Date(u,p,P),j=!1;a&&(j=N.getTime()s.getTime()),!j&&o&&(j=!1===o.call(e,N,"day"));var q=u===m&&p===v&&P===w,A=q?"day picked":"day";S.push(this.createItem({disabled:j,picked:q,highlighted:u===f&&p===g&&N.getDate()===y,text:P,view:j?"day disabled":A}))}this.$monthPrev.toggleClass(h,n),this.$monthNext.toggleClass(h,c),this.$monthCurrent.toggleClass(h,n&&c).html(i.yearFirst?"".concat(u+d," ").concat(l[p]):"".concat(l[p]," ").concat(u).concat(d)),this.$days.html(k.join("")+S.join("")+F.join(""))}},A="".concat(l,"-top-left"),t="".concat(l,"-top-right"),W="".concat(l,"-bottom-left"),e="".concat(l,"-bottom-right"),z=[A,t,W,e].join(" "),J=function(){function i(t){var e=1a.getTime()&&(s=new Date(a)),this.endDate=a),this.date=s,this.viewDate=new Date(s),this.initialDate=new Date(this.date),this.bind(),(e.autoShow||this.inline)&&this.show(),e.autoPick&&this.pick()}},{key:"build",value:function(){var t,e,i;this.built||(this.built=!0,t=this.$element,e=this.options,i=k(e.template),this.$picker=i,this.$week=i.find(Y("week")),this.$yearsPicker=i.find(Y("years picker")),this.$yearsPrev=i.find(Y("years prev")),this.$yearsNext=i.find(Y("years next")),this.$yearsCurrent=i.find(Y("years current")),this.$years=i.find(Y("years")),this.$monthsPicker=i.find(Y("months picker")),this.$yearPrev=i.find(Y("year prev")),this.$yearNext=i.find(Y("year next")),this.$yearCurrent=i.find(Y("year current")),this.$months=i.find(Y("months")),this.$daysPicker=i.find(Y("days picker")),this.$monthPrev=i.find(Y("month prev")),this.$monthNext=i.find(Y("month next")),this.$monthCurrent=i.find(Y("month current")),this.$days=i.find(Y("days")),this.inline?k(e.container||t).append(i.addClass("".concat(l,"-inline"))):(k(document.body).append(i.addClass("".concat(l,"-dropdown"))),i.addClass(g).css({zIndex:parseInt(e.zIndex,10)})),this.renderWeek())}},{key:"unbuild",value:function(){this.built&&(this.built=!1,this.$picker.remove())}},{key:"bind",value:function(){var t=this.options,e=this.$element;k.isFunction(t.show)&&e.on(p,t.show),k.isFunction(t.hide)&&e.on(o,t.hide),k.isFunction(t.pick)&&e.on(d,t.pick),this.isInput&&e.on(c,k.proxy(this.keyup,this)),this.inline||(t.trigger?this.$trigger.on(r,k.proxy(this.toggle,this)):this.isInput?e.on(h,k.proxy(this.show,this)):e.on(r,k.proxy(this.show,this)))}},{key:"unbind",value:function(){var t=this.$element,e=this.options;k.isFunction(e.show)&&t.off(p,e.show),k.isFunction(e.hide)&&t.off(o,e.hide),k.isFunction(e.pick)&&t.off(d,e.pick),this.isInput&&t.off(c,this.keyup),this.inline||(e.trigger?this.$trigger.off(r,this.toggle):this.isInput?t.off(h,this.show):t.off(r,this.show))}},{key:"showView",value:function(t){var e=this.$yearsPicker,i=this.$monthsPicker,a=this.$daysPicker,s=this.format;if(s.hasYear||s.hasMonth||s.hasDay)switch(Number(t)){case w:i.addClass(g),a.addClass(g),s.hasYear?(this.renderYears(),e.removeClass(g),this.place()):this.showView(m);break;case v:e.addClass(g),a.addClass(g),s.hasMonth?(this.renderMonths(),i.removeClass(g),this.place()):this.showView(w);break;default:e.addClass(g),i.addClass(g),s.hasDay?(this.renderDays(),a.removeClass(g),this.place()):this.showView(v)}}},{key:"hideView",value:function(){!this.inline&&this.options.autoHide&&this.hide()}},{key:"place",value:function(){var t,e,i,a,s,n,r,h,o,l,c;this.inline||(o=this.$element,c=this.options,t=this.$picker,e=k(document).outerWidth(),i=k(document).outerHeight(),a=o.outerWidth(),s=o.outerHeight(),n=t.width(),r=t.height(),h=(l=o.offset()).left,o=l.top,l=parseFloat(c.offset),c=A,C(l)&&(l=10),r').concat(a.text,"")}},{key:"getValue",value:function(){var t=this.$element;return this.isInput?t.val():t.text()}},{key:"setValue",value:function(t){var e=0