jquery.datetimepicker.min.js 48 KB

1
  1. function HighlightedDate(e,t,a){"use strict";this.date=e,this.desc=t,this.style=a}!function(e){"use strict";var t={i18n:{ar:{months:["كانون الثاني","شباط","آذار","نيسان","مايو","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول"],dayOfWeek:["ن","ث","ع","خ","ج","س","ح"]},ro:{months:["ianuarie","februarie","martie","aprilie","mai","iunie","iulie","august","septembrie","octombrie","noiembrie","decembrie"],dayOfWeek:["l","ma","mi","j","v","s","d"]},id:{months:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],dayOfWeek:["Min","Sen","Sel","Rab","Kam","Jum","Sab"]},is:{months:["Janúar","Febrúar","Mars","Apríl","Maí","Júní","Júlí","Ágúst","September","Október","Nóvember","Desember"],dayOfWeek:["Sun","Mán","Þrið","Mið","Fim","Fös","Lau"]},bg:{months:["Януари","Февруари","Март","Април","Май","Юни","Юли","Август","Септември","Октомври","Ноември","Декември"],dayOfWeek:["Нд","Пн","Вт","Ср","Чт","Пт","Сб"]},fa:{months:["فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذر","دی","بهمن","اسفند"],dayOfWeek:["یکشنبه","دوشنبه","سه شنبه","چهارشنبه","پنجشنبه","جمعه","شنبه"]},ru:{months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],dayOfWeek:["Вск","Пн","Вт","Ср","Чт","Пт","Сб"]},uk:{months:["Січень","Лютий","Березень","Квітень","Травень","Червень","Липень","Серпень","Вересень","Жовтень","Листопад","Грудень"],dayOfWeek:["Ндл","Пнд","Втр","Срд","Чтв","Птн","Сбт"]},en:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],dayOfWeek:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},el:{months:["Ιανουάριος","Φεβρουάριος","Μάρτιος","Απρίλιος","Μάιος","Ιούνιος","Ιούλιος","Αύγουστος","Σεπτέμβριος","Οκτώβριος","Νοέμβριος","Δεκέμβριος"],dayOfWeek:["Κυρ","Δευ","Τρι","Τετ","Πεμ","Παρ","Σαβ"]},de:{months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],dayOfWeek:["So","Mo","Di","Mi","Do","Fr","Sa"]},nl:{months:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],dayOfWeek:["zo","ma","di","wo","do","vr","za"]},tr:{months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],dayOfWeek:["Paz","Pts","Sal","Çar","Per","Cum","Cts"]},fr:{months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],dayOfWeek:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"]},es:{months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],dayOfWeek:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb"]},th:{months:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],dayOfWeek:["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."]},pl:{months:["styczeń","luty","marzec","kwiecień","maj","czerwiec","lipiec","sierpień","wrzesień","październik","listopad","grudzień"],dayOfWeek:["nd","pn","wt","śr","cz","pt","sb"]},pt:{months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],dayOfWeek:["Dom","Seg","Ter","Qua","Qui","Sex","Sab"]},ch:{months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayOfWeek:["日","一","二","三","四","五","六"]},se:{months:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],dayOfWeek:["Sön","Mån","Tis","Ons","Tor","Fre","Lör"]},kr:{months:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],dayOfWeek:["일","월","화","수","목","금","토"]},it:{months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],dayOfWeek:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"]},da:{months:["January","Februar","Marts","April","Maj","Juni","July","August","September","Oktober","November","December"],dayOfWeek:["Søn","Man","Tir","Ons","Tor","Fre","Lør"]},no:{months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],dayOfWeek:["Søn","Man","Tir","Ons","Tor","Fre","Lør"]},ja:{months:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["日","月","火","水","木","金","土"]},vi:{months:["Tháng 1","Tháng 2","Tháng 3","Tháng 4","Tháng 5","Tháng 6","Tháng 7","Tháng 8","Tháng 9","Tháng 10","Tháng 11","Tháng 12"],dayOfWeek:["CN","T2","T3","T4","T5","T6","T7"]},sl:{months:["Januar","Februar","Marec","April","Maj","Junij","Julij","Avgust","September","Oktober","November","December"],dayOfWeek:["Ned","Pon","Tor","Sre","Čet","Pet","Sob"]},cs:{months:["Leden","Únor","Březen","Duben","Květen","Červen","Červenec","Srpen","Září","Říjen","Listopad","Prosinec"],dayOfWeek:["Ne","Po","Út","St","Čt","Pá","So"]},hu:{months:["Január","Február","Március","Április","Május","Június","Július","Augusztus","Szeptember","Október","November","December"],dayOfWeek:["Va","Hé","Ke","Sze","Cs","Pé","Szo"]},az:{months:["Yanvar","Fevral","Mart","Aprel","May","Iyun","Iyul","Avqust","Sentyabr","Oktyabr","Noyabr","Dekabr"],dayOfWeek:["B","Be","Ça","Ç","Ca","C","Ş"]},bs:{months:["Januar","Februar","Mart","April","Maj","Jun","Jul","Avgust","Septembar","Oktobar","Novembar","Decembar"],dayOfWeek:["Ned","Pon","Uto","Sri","Čet","Pet","Sub"]},ca:{months:["Gener","Febrer","Març","Abril","Maig","Juny","Juliol","Agost","Setembre","Octubre","Novembre","Desembre"],dayOfWeek:["Dg","Dl","Dt","Dc","Dj","Dv","Ds"]},"en-GB":{months:["January","February","March","April","May","June","July","August","September","October","November","December"],dayOfWeek:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},et:{months:["Jaanuar","Veebruar","Märts","Aprill","Mai","Juuni","Juuli","August","September","Oktoober","November","Detsember"],dayOfWeek:["P","E","T","K","N","R","L"]},eu:{months:["Urtarrila","Otsaila","Martxoa","Apirila","Maiatza","Ekaina","Uztaila","Abuztua","Iraila","Urria","Azaroa","Abendua"],dayOfWeek:["Ig.","Al.","Ar.","Az.","Og.","Or.","La."]},fi:{months:["Tammikuu","Helmikuu","Maaliskuu","Huhtikuu","Toukokuu","Kesäkuu","Heinäkuu","Elokuu","Syyskuu","Lokakuu","Marraskuu","Joulukuu"],dayOfWeek:["Su","Ma","Ti","Ke","To","Pe","La"]},gl:{months:["Xan","Feb","Maz","Abr","Mai","Xun","Xul","Ago","Set","Out","Nov","Dec"],dayOfWeek:["Dom","Lun","Mar","Mer","Xov","Ven","Sab"]},hr:{months:["Siječanj","Veljača","Ožujak","Travanj","Svibanj","Lipanj","Srpanj","Kolovoz","Rujan","Listopad","Studeni","Prosinac"],dayOfWeek:["Ned","Pon","Uto","Sri","Čet","Pet","Sub"]},ko:{months:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],dayOfWeek:["일","월","화","수","목","금","토"]},lt:{months:["Sausio","Vasario","Kovo","Balandžio","Gegužės","Birželio","Liepos","Rugpjūčio","Rugsėjo","Spalio","Lapkričio","Gruodžio"],dayOfWeek:["Sek","Pir","Ant","Tre","Ket","Pen","Šeš"]},lv:{months:["Janvāris","Februāris","Marts","Aprīlis ","Maijs","Jūnijs","Jūlijs","Augusts","Septembris","Oktobris","Novembris","Decembris"],dayOfWeek:["Sv","Pr","Ot","Tr","Ct","Pk","St"]},mk:{months:["јануари","февруари","март","април","мај","јуни","јули","август","септември","октомври","ноември","декември"],dayOfWeek:["нед","пон","вто","сре","чет","пет","саб"]},mn:{months:["1-р сар","2-р сар","3-р сар","4-р сар","5-р сар","6-р сар","7-р сар","8-р сар","9-р сар","10-р сар","11-р сар","12-р сар"],dayOfWeek:["Дав","Мяг","Лха","Пүр","Бсн","Бям","Ням"]},"pt-BR":{months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],dayOfWeek:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"]},sk:{months:["Január","Február","Marec","Apríl","Máj","Jún","Júl","August","September","Október","November","December"],dayOfWeek:["Ne","Po","Ut","St","Št","Pi","So"]},sq:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],dayOfWeek:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},"sr-YU":{months:["Januar","Februar","Mart","April","Maj","Jun","Jul","Avgust","Septembar","Oktobar","Novembar","Decembar"],dayOfWeek:["Ned","Pon","Uto","Sre","čet","Pet","Sub"]},sr:{months:["јануар","фебруар","март","април","мај","јун","јул","август","септембар","октобар","новембар","децембар"],dayOfWeek:["нед","пон","уто","сре","чет","пет","суб"]},sv:{months:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],dayOfWeek:["Sön","Mån","Tis","Ons","Tor","Fre","Lör"]},"zh-TW":{months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayOfWeek:["日","一","二","三","四","五","六"]},zh:{months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayOfWeek:["日","一","二","三","四","五","六"]},he:{months:["ינואר","פברואר","מרץ","אפריל","מאי","יוני","יולי","אוגוסט","ספטמבר","אוקטובר","נובמבר","דצמבר"],dayOfWeek:["א'","ב'","ג'","ד'","ה'","ו'","שבת"]},hy:{months:["Հունվար","Փետրվար","Մարտ","Ապրիլ","Մայիս","Հունիս","Հուլիս","Օգոստոս","Սեպտեմբեր","Հոկտեմբեր","Նոյեմբեր","Դեկտեմբեր"],dayOfWeek:["Կի","Երկ","Երք","Չոր","Հնգ","Ուրբ","Շբթ"]},kg:{months:["Үчтүн айы","Бирдин айы","Жалган Куран","Чын Куран","Бугу","Кулжа","Теке","Баш Оона","Аяк Оона","Тогуздун айы","Жетинин айы","Бештин айы"],dayOfWeek:["Жек","Дүй","Шей","Шар","Бей","Жум","Ише"]}},value:"",lang:"en",rtl:!1,format:"Y/m/d H:i",formatTime:"H:i",formatDate:"Y/m/d",startDate:!1,step:60,monthChangeSpinner:!0,closeOnDateSelect:!1,closeOnTimeSelect:!0,closeOnWithoutClick:!0,closeOnInputClick:!0,timepicker:!0,datepicker:!0,weeks:!1,defaultTime:!1,defaultDate:!1,minDate:!1,maxDate:!1,minTime:!1,maxTime:!1,disabledMinTime:!1,disabledMaxTime:!1,allowTimes:[],opened:!1,initTime:!0,inline:!1,theme:"",onSelectDate:function(){},onSelectTime:function(){},onChangeMonth:function(){},onChangeYear:function(){},onChangeDateTime:function(){},onShow:function(){},onClose:function(){},onGenerate:function(){},withoutCopyright:!0,inverseButton:!1,hours12:!1,next:"xdsoft_next",prev:"xdsoft_prev",dayOfWeekStart:0,parentID:"body",timeHeightInTimePicker:25,timepickerScrollbar:!0,todayButton:!0,prevButton:!0,nextButton:!0,defaultSelect:!0,scrollMonth:!0,scrollTime:!0,scrollInput:!0,lazyInit:!1,mask:!1,validateOnBlur:!0,allowBlank:!0,yearStart:1950,yearEnd:2050,monthStart:0,monthEnd:11,style:"",id:"",fixed:!1,roundTime:"round",className:"",weekends:[],highlightedDates:[],highlightedPeriods:[],disabledDates:[],disabledWeekDays:[],yearOffset:0,beforeShowDay:null,enterLikeTab:!0,showApplyButton:!1};window.getComputedStyle||(window.getComputedStyle=function(e,t){return this.el=e,this.getPropertyValue=function(t){var a=/(\-([a-z]){1})/g;return"float"===t&&(t="styleFloat"),a.test(t)&&(t=t.replace(a,function(e,t,a){return a.toUpperCase()})),e.currentStyle[t]||null},this}),Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){var a,n;for(a=t||0,n=this.length;a<n;a+=1)if(this[a]===e)return a;return-1}),Date.prototype.countDaysInMonth=function(){return new Date(this.getFullYear(),this.getMonth()+1,0).getDate()},e.fn.xdsoftScroller=function(t){return this.each(function(){var a,n,r,o,s,i=e(this),u=function(e){var t,a={x:0,y:0};return"touchstart"===e.type||"touchmove"===e.type||"touchend"===e.type||"touchcancel"===e.type?(t=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0],a.x=t.clientX,a.y=t.clientY):"mousedown"!==e.type&&"mouseup"!==e.type&&"mousemove"!==e.type&&"mouseover"!==e.type&&"mouseout"!==e.type&&"mouseenter"!==e.type&&"mouseleave"!==e.type||(a.x=e.clientX,a.y=e.clientY),a},d=100,l=!1,c=0,f=0,m=0,h=!1,g=0,p=function(){};"hide"!==t?(e(this).hasClass("xdsoft_scroller_box")||(a=i.children().eq(0),n=i[0].clientHeight,r=a[0].offsetHeight,o=e('<div class="xdsoft_scrollbar"></div>'),s=e('<div class="xdsoft_scroller"></div>'),o.append(s),i.addClass("xdsoft_scroller_box").append(o),p=function(e){var t=u(e).y-c+g;t<0&&(t=0),t+s[0].offsetHeight>m&&(t=m-s[0].offsetHeight),i.trigger("scroll_element.xdsoft_scroller",[d?t/d:0])},s.on("touchstart.xdsoft_scroller mousedown.xdsoft_scroller",function(a){n||i.trigger("resize_scroll.xdsoft_scroller",[t]),c=u(a).y,g=parseInt(s.css("margin-top"),10),m=o[0].offsetHeight,"mousedown"===a.type?(document&&e(document.body).addClass("xdsoft_noselect"),e([document.body,window]).on("mouseup.xdsoft_scroller",function t(){e([document.body,window]).off("mouseup.xdsoft_scroller",t).off("mousemove.xdsoft_scroller",p).removeClass("xdsoft_noselect")}),e(document.body).on("mousemove.xdsoft_scroller",p)):(h=!0,a.stopPropagation(),a.preventDefault())}).on("touchmove",function(e){h&&(e.preventDefault(),p(e))}).on("touchend touchcancel",function(e){h=!1,g=0}),i.on("scroll_element.xdsoft_scroller",function(e,t){n||i.trigger("resize_scroll.xdsoft_scroller",[t,!0]),t=t>1?1:t<0||isNaN(t)?0:t,s.css("margin-top",d*t),setTimeout(function(){a.css("marginTop",-parseInt((a[0].offsetHeight-n)*t,10))},10)}).on("resize_scroll.xdsoft_scroller",function(e,t,u){var l,c;n=i[0].clientHeight,r=a[0].offsetHeight,c=(l=n/r)*o[0].offsetHeight,l>1?s.hide():(s.show(),s.css("height",parseInt(c>10?c:10,10)),d=o[0].offsetHeight-s[0].offsetHeight,!0!==u&&i.trigger("scroll_element.xdsoft_scroller",[t||Math.abs(parseInt(a.css("marginTop"),10))/(r-n)]))}),i.on("mousewheel",function(e){var t=Math.abs(parseInt(a.css("marginTop"),10));return(t-=20*e.deltaY)<0&&(t=0),i.trigger("scroll_element.xdsoft_scroller",[t/(r-n)]),e.stopPropagation(),!1}),i.on("touchstart",function(e){l=u(e),f=Math.abs(parseInt(a.css("marginTop"),10))}),i.on("touchmove",function(e){if(l){e.preventDefault();var t=u(e);i.trigger("scroll_element.xdsoft_scroller",[(f-(t.y-l.y))/(r-n)])}}),i.on("touchend touchcancel",function(e){l=!1,f=0})),i.trigger("resize_scroll.xdsoft_scroller",[t])):i.find(".xdsoft_scrollbar").hide()})},e.fn.datetimepicker=function(a){var n,r,o=17,s=13,i=27,u=37,d=38,l=39,c=40,f=9,m=116,h=65,g=67,p=86,D=90,y=89,x=!1,v=e.isPlainObject(a)||!a?e.extend(!0,{},t,a):e.extend(!0,{},t),b=0;return n=function(t){function n(){var e,a=!1;return v.startDate?a=w.strToDate(v.startDate):(a=v.value||(t&&t.val&&t.val()?t.val():""))?a=w.strToDateTime(a):v.defaultDate&&(a=w.strToDateTime(v.defaultDate),v.defaultTime&&(e=w.strtotime(v.defaultTime),a.setHours(e.getHours()),a.setMinutes(e.getMinutes()))),a&&w.isValidDate(a)?M.data("changed",!0):a="",a||0}var r,b,T,k,w,M=e('<div class="xdsoft_datetimepicker xdsoft_noselect"></div>'),S=e('<div class="xdsoft_copyright"><a target="_blank" href="http://xdsoft.net/jqplugins/datetimepicker/">xdsoft.net</a></div>'),O=e('<div class="xdsoft_datepicker active"></div>'),_=e('<div class="xdsoft_mounthpicker"><button type="button" class="xdsoft_prev"></button><button type="button" class="xdsoft_today_button"></button><div class="xdsoft_label xdsoft_month"><span></span><i></i></div><div class="xdsoft_label xdsoft_year"><span></span><i></i></div><button type="button" class="xdsoft_next"></button></div>'),F=e('<div class="xdsoft_calendar"></div>'),A=e('<div class="xdsoft_timepicker active"><button type="button" class="xdsoft_prev"></button><div class="xdsoft_time_box"></div><button type="button" class="xdsoft_next"></button></div>'),W=A.find(".xdsoft_time_box").eq(0),C=e('<div class="xdsoft_time_variant"></div>'),P=e('<button type="button" class="xdsoft_save_selected blue-gradient-button">Save Selected</button>'),Y=e('<div class="xdsoft_select xdsoft_monthselect"><div></div></div>'),J=e('<div class="xdsoft_select xdsoft_yearselect"><div></div></div>'),H=!1,I=0;v.id&&M.attr("id",v.id),v.style&&M.attr("style",v.style),v.weeks&&M.addClass("xdsoft_showweeks"),v.rtl&&M.addClass("xdsoft_rtl"),M.addClass("xdsoft_"+v.theme),M.addClass(v.className),_.find(".xdsoft_month span").after(Y),_.find(".xdsoft_year span").after(J),_.find(".xdsoft_month,.xdsoft_year").on("mousedown.xdsoft",function(t){var a,n,r=e(this).find(".xdsoft_select").eq(0),o=0,s=0,i=r.is(":visible");for(_.find(".xdsoft_select").hide(),w.currentTime&&(o=w.currentTime[e(this).hasClass("xdsoft_month")?"getMonth":"getFullYear"]()),r[i?"hide":"show"](),a=r.find("div.xdsoft_option"),n=0;n<a.length&&a.eq(n).data("value")!==o;n+=1)s+=a[0].offsetHeight;return r.xdsoftScroller(s/(r.children()[0].offsetHeight-r[0].clientHeight)),t.stopPropagation(),!1}),_.find(".xdsoft_select").xdsoftScroller().on("mousedown.xdsoft",function(e){e.stopPropagation(),e.preventDefault()}).on("mousedown.xdsoft",".xdsoft_option",function(t){void 0!==w.currentTime&&null!==w.currentTime||(w.currentTime=w.now());var a=w.currentTime.getFullYear();w&&w.currentTime&&w.currentTime[e(this).parent().parent().hasClass("xdsoft_monthselect")?"setMonth":"setFullYear"](e(this).data("value")),e(this).parent().parent().hide(),M.trigger("xchange.xdsoft"),v.onChangeMonth&&e.isFunction(v.onChangeMonth)&&v.onChangeMonth.call(M,w.currentTime,M.data("input")),a!==w.currentTime.getFullYear()&&e.isFunction(v.onChangeYear)&&v.onChangeYear.call(M,w.currentTime,M.data("input"))}),M.setOptions=function(a){var n={},r=function(e,t){var a=e.replace(/([\[\]\/\{\}\(\)\-\.\+]{1})/g,"\\$1").replace(/_/g,"{digit+}").replace(/([0-9]{1})/g,"{digit$1}").replace(/\{digit([0-9]{1})\}/g,"[0-$1_]{1}").replace(/\{digit[\+]\}/g,"[0-9_]{1}");return new RegExp(a).test(t)};v=e.extend(!0,{},v,a),a.allowTimes&&e.isArray(a.allowTimes)&&a.allowTimes.length&&(v.allowTimes=e.extend(!0,[],a.allowTimes)),a.weekends&&e.isArray(a.weekends)&&a.weekends.length&&(v.weekends=e.extend(!0,[],a.weekends)),a.highlightedDates&&e.isArray(a.highlightedDates)&&a.highlightedDates.length&&(e.each(a.highlightedDates,function(t,a){var r,o=e.map(a.split(","),e.trim),s=new HighlightedDate(Date.parseDate(o[0],v.formatDate),o[1],o[2]),i=s.date.dateFormat(v.formatDate);void 0!==n[i]?(r=n[i].desc)&&r.length&&s.desc&&s.desc.length&&(n[i].desc=r+"\n"+s.desc):n[i]=s}),v.highlightedDates=e.extend(!0,[],n)),a.highlightedPeriods&&e.isArray(a.highlightedPeriods)&&a.highlightedPeriods.length&&(n=e.extend(!0,[],v.highlightedDates),e.each(a.highlightedPeriods,function(t,a){var r,o,s,i,u,d,l;if(e.isArray(a))r=a[0],o=a[1],s=a[2],l=a[3];else{var c=e.map(a.split(","),e.trim);r=Date.parseDate(c[0],v.formatDate),o=Date.parseDate(c[1],v.formatDate),s=c[2],l=c[3]}for(;r<=o;)i=new HighlightedDate(r,s,l),u=r.dateFormat(v.formatDate),r.setDate(r.getDate()+1),void 0!==n[u]?(d=n[u].desc)&&d.length&&i.desc&&i.desc.length&&(n[u].desc=d+"\n"+i.desc):n[u]=i}),v.highlightedDates=e.extend(!0,[],n)),a.disabledDates&&e.isArray(a.disabledDates)&&a.disabledDates.length&&(v.disabledDates=e.extend(!0,[],a.disabledDates)),a.disabledWeekDays&&e.isArray(a.disabledWeekDays)&&a.disabledWeekDays.length&&(v.disabledWeekDays=e.extend(!0,[],a.disabledWeekDays)),!v.open&&!v.opened||v.inline||t.trigger("open.xdsoft"),v.inline&&(H=!0,M.addClass("xdsoft_inline"),t.after(M).hide()),v.inverseButton&&(v.next="xdsoft_prev",v.prev="xdsoft_next"),v.datepicker?O.addClass("active"):O.removeClass("active"),v.timepicker?A.addClass("active"):A.removeClass("active"),v.value&&(w.setCurrentTime(v.value),t&&t.val&&t.val(w.str)),isNaN(v.dayOfWeekStart)?v.dayOfWeekStart=0:v.dayOfWeekStart=parseInt(v.dayOfWeekStart,10)%7,v.timepickerScrollbar||W.xdsoftScroller("hide"),v.minDate&&/^[\+\-](.*)$/.test(v.minDate)&&(v.minDate=w.strToDateTime(v.minDate).dateFormat(v.formatDate)),v.maxDate&&/^[\+\-](.*)$/.test(v.maxDate)&&(v.maxDate=w.strToDateTime(v.maxDate).dateFormat(v.formatDate)),P.toggle(v.showApplyButton),_.find(".xdsoft_today_button").css("visibility",v.todayButton?"visible":"hidden"),_.find("."+v.prev).css("visibility",v.prevButton?"visible":"hidden"),_.find("."+v.next).css("visibility",v.nextButton?"visible":"hidden"),v.mask&&(t.off("keydown.xdsoft"),!0===v.mask&&(v.mask=v.format.replace(/Y/g,"9999").replace(/F/g,"9999").replace(/m/g,"19").replace(/d/g,"39").replace(/H/g,"29").replace(/i/g,"59").replace(/s/g,"59")),"string"===e.type(v.mask)&&(r(v.mask,t.val())||t.val(v.mask.replace(/[0-9]/g,"_")),t.on("keydown.xdsoft",function(a){var n,b,T=this.value,k=a.which;if(k>=48&&k<=57||k>=96&&k<=105||8===k||46===k){for(n=function(e){try{if(document.selection&&document.selection.createRange)return document.selection.createRange().getBookmark().charCodeAt(2)-2;if(e.setSelectionRange)return e.selectionStart}catch(e){return 0}}(this),b=8!==k&&46!==k?String.fromCharCode(96<=k&&k<=105?k-48:k):"_",8!==k&&46!==k||!n||(n-=1,b="_");/[^0-9_]/.test(v.mask.substr(n,1))&&n<v.mask.length&&n>0;)n+=8===k||46===k?-1:1;if(T=T.substr(0,n)+b+T.substr(n+1),""===e.trim(T))T=v.mask.replace(/[0-9]/g,"_");else if(n===v.mask.length)return a.preventDefault(),!1;for(n+=8===k||46===k?0:1;/[^0-9_]/.test(v.mask.substr(n,1))&&n<v.mask.length&&n>0;)n+=8===k||46===k?-1:1;r(v.mask,T)?(this.value=T,function(e,t){if(!(e="string"==typeof e||e instanceof String?document.getElementById(e):e))return!1;if(e.createTextRange){var a=e.createTextRange();return a.collapse(!0),a.moveEnd("character",t),a.moveStart("character",t),a.select(),!0}!!e.setSelectionRange&&e.setSelectionRange(t,t)}(this,n)):""===e.trim(T)?this.value=v.mask.replace(/[0-9]/g,"_"):t.trigger("error_input.xdsoft")}else if(-1!==[h,g,p,D,y].indexOf(k)&&x||-1!==[i,d,c,u,l,m,o,f,s].indexOf(k))return!0;return a.preventDefault(),!1}))),v.validateOnBlur&&t.off("blur.xdsoft").on("blur.xdsoft",function(){if(v.allowBlank&&!e.trim(e(this).val()).length)e(this).val(null),M.data("xdsoft_datetime").empty();else if(Date.parseDate(e(this).val(),v.format))M.data("xdsoft_datetime").setCurrentTime(e(this).val());else{var t=+[e(this).val()[0],e(this).val()[1]].join(""),a=+[e(this).val()[2],e(this).val()[3]].join("");!v.datepicker&&v.timepicker&&t>=0&&t<24&&a>=0&&a<60?e(this).val([t,a].map(function(e){return e>9?e:"0"+e}).join(":")):e(this).val(w.now().dateFormat(v.format)),M.data("xdsoft_datetime").setCurrentTime(e(this).val())}M.trigger("changedatetime.xdsoft")}),v.dayOfWeekStartPrev=0===v.dayOfWeekStart?6:v.dayOfWeekStart-1,M.trigger("xchange.xdsoft").trigger("afterOpen.xdsoft")},M.data("options",v).on("mousedown.xdsoft",function(e){return e.stopPropagation(),e.preventDefault(),J.hide(),Y.hide(),!1}),W.append(C),W.xdsoftScroller(),M.on("afterOpen.xdsoft",function(){W.xdsoftScroller()}),M.append(O).append(A),!0!==v.withoutCopyright&&M.append(S),O.append(_).append(F).append(P),e(v.parentID).append(M),w=new function(){var t=this;t.now=function(e){var a,n,r=new Date;return!e&&v.defaultDate&&(a=t.strToDateTime(v.defaultDate),r.setFullYear(a.getFullYear()),r.setMonth(a.getMonth()),r.setDate(a.getDate())),v.yearOffset&&r.setFullYear(r.getFullYear()+v.yearOffset),!e&&v.defaultTime&&(n=t.strtotime(v.defaultTime),r.setHours(n.getHours()),r.setMinutes(n.getMinutes())),r},t.isValidDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.getTime())},t.setCurrentTime=function(e){t.currentTime="string"==typeof e?t.strToDateTime(e):t.isValidDate(e)?e:t.now(),M.trigger("xchange.xdsoft")},t.empty=function(){t.currentTime=null},t.getCurrentTime=function(e){return t.currentTime},t.nextMonth=function(){void 0!==t.currentTime&&null!==t.currentTime||(t.currentTime=t.now());var a,n=t.currentTime.getMonth()+1;return 12===n&&(t.currentTime.setFullYear(t.currentTime.getFullYear()+1),n=0),a=t.currentTime.getFullYear(),t.currentTime.setDate(Math.min(new Date(t.currentTime.getFullYear(),n+1,0).getDate(),t.currentTime.getDate())),t.currentTime.setMonth(n),v.onChangeMonth&&e.isFunction(v.onChangeMonth)&&v.onChangeMonth.call(M,w.currentTime,M.data("input")),a!==t.currentTime.getFullYear()&&e.isFunction(v.onChangeYear)&&v.onChangeYear.call(M,w.currentTime,M.data("input")),M.trigger("xchange.xdsoft"),n},t.prevMonth=function(){void 0!==t.currentTime&&null!==t.currentTime||(t.currentTime=t.now());var a=t.currentTime.getMonth()-1;return-1===a&&(t.currentTime.setFullYear(t.currentTime.getFullYear()-1),a=11),t.currentTime.setDate(Math.min(new Date(t.currentTime.getFullYear(),a+1,0).getDate(),t.currentTime.getDate())),t.currentTime.setMonth(a),v.onChangeMonth&&e.isFunction(v.onChangeMonth)&&v.onChangeMonth.call(M,w.currentTime,M.data("input")),M.trigger("xchange.xdsoft"),a},t.getWeekOfYear=function(e){var t=new Date(e.getFullYear(),0,1);return Math.ceil(((e-t)/864e5+t.getDay()+1)/7)},t.strToDateTime=function(e){var a,n,r=[];return e&&e instanceof Date&&t.isValidDate(e)?e:((r=/^(\+|\-)(.*)$/.exec(e))&&(r[2]=Date.parseDate(r[2],v.formatDate)),r&&r[2]?(a=r[2].getTime()-6e4*r[2].getTimezoneOffset(),n=new Date(t.now(!0).getTime()+parseInt(r[1]+"1",10)*a)):n=e?Date.parseDate(e,v.format):t.now(),t.isValidDate(n)||(n=t.now()),n)},t.strToDate=function(e){if(e&&e instanceof Date&&t.isValidDate(e))return e;var a=e?Date.parseDate(e,v.formatDate):t.now(!0);return t.isValidDate(a)||(a=t.now(!0)),a},t.strtotime=function(e){if(e&&e instanceof Date&&t.isValidDate(e))return e;var a=e?Date.parseDate(e,v.formatTime):t.now(!0);return t.isValidDate(a)||(a=t.now(!0)),a},t.str=function(){return t.currentTime.dateFormat(v.format)},t.currentTime=this.now()},P.on("click",function(e){e.preventDefault(),M.data("changed",!0),w.setCurrentTime(n()),t.val(w.str()),M.trigger("close.xdsoft")}),_.find(".xdsoft_today_button").on("mousedown.xdsoft",function(){M.data("changed",!0),w.setCurrentTime(0),M.trigger("afterOpen.xdsoft")}).on("dblclick.xdsoft",function(){var e,a,n=w.getCurrentTime();n=new Date(n.getFullYear(),n.getMonth(),n.getDate()),e=w.strToDate(v.minDate),n<(e=new Date(e.getFullYear(),e.getMonth(),e.getDate()))||(a=w.strToDate(v.maxDate),n>(a=new Date(a.getFullYear(),a.getMonth(),a.getDate()))||(t.val(w.str()),t.trigger("change"),M.trigger("close.xdsoft")))}),_.find(".xdsoft_prev,.xdsoft_next").on("mousedown.xdsoft",function(){var t=e(this),a=0,n=!1;!function e(r){t.hasClass(v.next)?w.nextMonth():t.hasClass(v.prev)&&w.prevMonth(),v.monthChangeSpinner&&(n||(a=setTimeout(e,r||100)))}(500),e([document.body,window]).on("mouseup.xdsoft",function t(){clearTimeout(a),n=!0,e([document.body,window]).off("mouseup.xdsoft",t)})}),A.find(".xdsoft_prev,.xdsoft_next").on("mousedown.xdsoft",function(){var t=e(this),a=0,n=!1,r=110;!function e(o){var s=W[0].clientHeight,i=C[0].offsetHeight,u=Math.abs(parseInt(C.css("marginTop"),10));t.hasClass(v.next)&&i-s-v.timeHeightInTimePicker>=u?C.css("marginTop","-"+(u+v.timeHeightInTimePicker)+"px"):t.hasClass(v.prev)&&u-v.timeHeightInTimePicker>=0&&C.css("marginTop","-"+(u-v.timeHeightInTimePicker)+"px"),W.trigger("scroll_element.xdsoft_scroller",[Math.abs(parseInt(C.css("marginTop"),10)/(i-s))]),r=r>10?10:r-10,n||(a=setTimeout(e,o||r))}(500),e([document.body,window]).on("mouseup.xdsoft",function t(){clearTimeout(a),n=!0,e([document.body,window]).off("mouseup.xdsoft",t)})}),r=0,M.on("xchange.xdsoft",function(t){clearTimeout(r),r=setTimeout(function(){void 0!==w.currentTime&&null!==w.currentTime||(w.currentTime=w.now());for(var t,n,r,o,s,i,u,d,l,c,f="",m=new Date(w.currentTime.getFullYear(),w.currentTime.getMonth(),1,12,0,0),h=0,g=w.now(),p=!1,D=!1,y=[],x=!0,b="";m.getDay()!==v.dayOfWeekStart;)m.setDate(m.getDate()-1);for(f+="<table><thead><tr>",v.weeks&&(f+="<th></th>"),t=0;t<7;t+=1)f+="<th>"+v.i18n[v.lang].dayOfWeek[(t+v.dayOfWeekStart)%7]+"</th>";for(f+="</tr></thead>",f+="<tbody>",!1!==v.maxDate&&(p=w.strToDate(v.maxDate),p=new Date(p.getFullYear(),p.getMonth(),p.getDate(),23,59,59,999)),!1!==v.minDate&&(D=w.strToDate(v.minDate),D=new Date(D.getFullYear(),D.getMonth(),D.getDate()));h<w.currentTime.countDaysInMonth()||m.getDay()!==v.dayOfWeekStart||w.currentTime.getMonth()===m.getMonth();)y=[],h+=1,r=m.getDay(),o=m.getDate(),s=m.getFullYear(),i=m.getMonth(),u=w.getWeekOfYear(m),c="",y.push("xdsoft_date"),d=v.beforeShowDay&&e.isFunction(v.beforeShowDay.call)?v.beforeShowDay.call(M,m):null,!1!==p&&m>p||!1!==D&&m<D||d&&!1===d[0]?y.push("xdsoft_disabled"):-1!==v.disabledDates.indexOf(m.dateFormat(v.formatDate))?y.push("xdsoft_disabled"):-1!==v.disabledWeekDays.indexOf(r)&&y.push("xdsoft_disabled"),d&&""!==d[1]&&y.push(d[1]),w.currentTime.getMonth()!==i&&y.push("xdsoft_other_month"),(v.defaultSelect||M.data("changed"))&&w.currentTime.dateFormat(v.formatDate)===m.dateFormat(v.formatDate)&&y.push("xdsoft_current"),g.dateFormat(v.formatDate)===m.dateFormat(v.formatDate)&&y.push("xdsoft_today"),0!==m.getDay()&&6!==m.getDay()&&-1===v.weekends.indexOf(m.dateFormat(v.formatDate))||y.push("xdsoft_weekend"),void 0!==v.highlightedDates[m.dateFormat(v.formatDate)]&&(n=v.highlightedDates[m.dateFormat(v.formatDate)],y.push(void 0===n.style?"xdsoft_highlighted_default":n.style),c=void 0===n.desc?"":n.desc),v.beforeShowDay&&e.isFunction(v.beforeShowDay)&&y.push(v.beforeShowDay(m)),x&&(f+="<tr>",x=!1,v.weeks&&(f+="<th>"+u+"</th>")),f+='<td data-date="'+o+'" data-month="'+i+'" data-year="'+s+'" class="xdsoft_date xdsoft_day_of_week'+m.getDay()+" "+y.join(" ")+'" title="'+c+'"><div>'+o+"</div></td>",m.getDay()===v.dayOfWeekStartPrev&&(f+="</tr>",x=!0),m.setDate(o+1);if(f+="</tbody></table>",F.html(f),_.find(".xdsoft_label span").eq(0).text(v.i18n[v.lang].months[w.currentTime.getMonth()]),_.find(".xdsoft_label span").eq(1).text(w.currentTime.getFullYear()),b="","",i="",l=function(e,t){var a,n,r=w.now();r.setHours(e),e=parseInt(r.getHours(),10),r.setMinutes(t),t=parseInt(r.getMinutes(),10),(a=new Date(w.currentTime)).setHours(e),a.setMinutes(t),y=[],(!1!==v.minDateTime&&v.minDateTime>a||!1!==v.maxTime&&w.strtotime(v.maxTime).getTime()<r.getTime()||!1!==v.minTime&&w.strtotime(v.minTime).getTime()>r.getTime())&&y.push("xdsoft_disabled"),(!1!==v.minDateTime&&v.minDateTime>a||!1!==v.disabledMinTime&&r.getTime()>w.strtotime(v.disabledMinTime).getTime()&&!1!==v.disabledMaxTime&&r.getTime()<w.strtotime(v.disabledMaxTime).getTime())&&y.push("xdsoft_disabled"),(n=new Date(w.currentTime)).setHours(parseInt(w.currentTime.getHours(),10)),n.setMinutes(Math[v.roundTime](w.currentTime.getMinutes()/v.step)*v.step),(v.initTime||v.defaultSelect||M.data("changed"))&&n.getHours()===parseInt(e,10)&&(v.step>59||n.getMinutes()===parseInt(t,10))&&(v.defaultSelect||M.data("changed")?y.push("xdsoft_current"):v.initTime&&y.push("xdsoft_init_time")),parseInt(g.getHours(),10)===parseInt(e,10)&&parseInt(g.getMinutes(),10)===parseInt(t,10)&&y.push("xdsoft_today"),b+='<div class="xdsoft_time '+y.join(" ")+'" data-hour="'+e+'" data-minute="'+t+'">'+r.dateFormat(v.formatTime)+"</div>"},v.allowTimes&&e.isArray(v.allowTimes)&&v.allowTimes.length)for(h=0;h<v.allowTimes.length;h+=1)l(w.strtotime(v.allowTimes[h]).getHours(),i=w.strtotime(v.allowTimes[h]).getMinutes());else for(h=0,t=0;h<(v.hours12?12:24);h+=1)for(t=0;t<60;t+=v.step)l((h<10?"0":"")+h,i=(t<10?"0":"")+t);for(C.html(b),a="",h=0,h=parseInt(v.yearStart,10)+v.yearOffset;h<=parseInt(v.yearEnd,10)+v.yearOffset;h+=1)a+='<div class="xdsoft_option '+(w.currentTime.getFullYear()===h?"xdsoft_current":"")+'" data-value="'+h+'">'+h+"</div>";for(J.children().eq(0).html(a),h=parseInt(v.monthStart,10),a="";h<=parseInt(v.monthEnd,10);h+=1)a+='<div class="xdsoft_option '+(w.currentTime.getMonth()===h?"xdsoft_current":"")+'" data-value="'+h+'">'+v.i18n[v.lang].months[h]+"</div>";Y.children().eq(0).html(a),e(M).trigger("generate.xdsoft")},10),t.stopPropagation()}).on("afterOpen.xdsoft",function(){if(v.timepicker){var e,t,a,n;C.find(".xdsoft_current").length?e=".xdsoft_current":C.find(".xdsoft_init_time").length&&(e=".xdsoft_init_time"),e?(t=W[0].clientHeight,(a=C[0].offsetHeight)-t<(n=C.find(e).index()*v.timeHeightInTimePicker+1)&&(n=a-t),W.trigger("scroll_element.xdsoft_scroller",[parseInt(n,10)/(a-t)])):W.trigger("scroll_element.xdsoft_scroller",[0])}}),b=0,F.on("click.xdsoft","td",function(a){a.stopPropagation(),b+=1;var n=e(this),r=w.currentTime;if(void 0!==r&&null!==r||(w.currentTime=w.now(),r=w.currentTime),n.hasClass("xdsoft_disabled"))return!1;r.setDate(1),r.setFullYear(n.data("year")),r.setMonth(n.data("month")),r.setDate(n.data("date")),M.trigger("select.xdsoft",[r]),t.val(w.str()),(b>1||!0===v.closeOnDateSelect||!1===v.closeOnDateSelect&&!v.timepicker)&&!v.inline&&M.trigger("close.xdsoft"),v.onSelectDate&&e.isFunction(v.onSelectDate)&&v.onSelectDate.call(M,w.currentTime,M.data("input"),a),M.data("changed",!0),M.trigger("xchange.xdsoft"),M.trigger("changedatetime.xdsoft"),setTimeout(function(){b=0},200)}),C.on("click.xdsoft","div",function(t){t.stopPropagation();var a=e(this),n=w.currentTime;if(void 0!==n&&null!==n||(w.currentTime=w.now(),n=w.currentTime),a.hasClass("xdsoft_disabled"))return!1;n.setHours(a.data("hour")),n.setMinutes(a.data("minute")),M.trigger("select.xdsoft",[n]),M.data("input").val(w.str()),!0!==v.inline&&!0===v.closeOnTimeSelect&&M.trigger("close.xdsoft"),v.onSelectTime&&e.isFunction(v.onSelectTime)&&v.onSelectTime.call(M,w.currentTime,M.data("input"),t),M.data("changed",!0),M.trigger("xchange.xdsoft"),M.trigger("changedatetime.xdsoft")}),O.on("mousewheel.xdsoft",function(e){return!v.scrollMonth||(e.deltaY<0?w.nextMonth():w.prevMonth(),!1)}),t.on("mousewheel.xdsoft",function(e){return!v.scrollInput||(!v.datepicker&&v.timepicker?((T=C.find(".xdsoft_current").length?C.find(".xdsoft_current").eq(0).index():0)+e.deltaY>=0&&T+e.deltaY<C.children().length&&(T+=e.deltaY),C.children().eq(T).length&&C.children().eq(T).trigger("mousedown"),!1):v.datepicker&&!v.timepicker?(O.trigger(e,[e.deltaY,e.deltaX,e.deltaY]),t.val&&t.val(w.str()),M.trigger("changedatetime.xdsoft"),!1):void 0)}),M.on("changedatetime.xdsoft",function(t){if(v.onChangeDateTime&&e.isFunction(v.onChangeDateTime)){var a=M.data("input");v.onChangeDateTime.call(M,w.currentTime,a,t),delete v.value,a.trigger("change")}}).on("generate.xdsoft",function(){v.onGenerate&&e.isFunction(v.onGenerate)&&v.onGenerate.call(M,w.currentTime,M.data("input")),H&&(M.trigger("afterOpen.xdsoft"),H=!1)}).on("click.xdsoft",function(e){e.stopPropagation()}),T=0,k=function(){var t,a=M.data("input").offset(),n=a.top+M.data("input")[0].offsetHeight-1,r=a.left,o="absolute";"rtl"==M.data("input").parent().css("direction")&&(r-=M.outerWidth()-M.data("input").outerWidth()),v.fixed?(n-=e(window).scrollTop(),r-=e(window).scrollLeft(),o="fixed"):(n+M[0].offsetHeight>e(window).height()+e(window).scrollTop()&&(n=a.top-M[0].offsetHeight+1),n<0&&(n=0),r+M[0].offsetWidth>e(window).width()&&(r=e(window).width()-M[0].offsetWidth)),t=M[0];do{if(t=t.parentNode,"relative"===window.getComputedStyle(t).getPropertyValue("position")&&e(window).width()>=t.offsetWidth){r-=(e(window).width()-t.offsetWidth)/2;break}}while("HTML"!==t.nodeName);M.css({left:r,top:n,position:o})},M.on("open.xdsoft",function(t){var a=!0;v.onShow&&e.isFunction(v.onShow)&&(a=v.onShow.call(M,w.currentTime,M.data("input"),t)),!1!==a&&(M.show(),k(),e(window).off("resize.xdsoft",k).on("resize.xdsoft",k),v.closeOnWithoutClick&&e([document.body,window]).on("mousedown.xdsoft",function t(){M.trigger("close.xdsoft"),e([document.body,window]).off("mousedown.xdsoft",t)}))}).on("close.xdsoft",function(t){var a=!0;_.find(".xdsoft_month,.xdsoft_year").find(".xdsoft_select").hide(),v.onClose&&e.isFunction(v.onClose)&&(a=v.onClose.call(M,w.currentTime,M.data("input"),t)),!1===a||v.opened||v.inline||M.hide(),t.stopPropagation()}).on("toggle.xdsoft",function(e){M.is(":visible")?M.trigger("close.xdsoft"):M.trigger("open.xdsoft")}).data("input",t),I=0,M.data("xdsoft_datetime",w),M.setOptions(v),w.setCurrentTime(n()),t.data("xdsoft_datetimepicker",M).on("open.xdsoft focusin.xdsoft mousedown.xdsoft",function(e){t.is(":disabled")||t.data("xdsoft_datetimepicker").is(":visible")&&v.closeOnInputClick||(clearTimeout(I),I=setTimeout(function(){t.is(":disabled")||(H=!0,w.setCurrentTime(n()),M.trigger("open.xdsoft"))},100))}).on("keydown.xdsoft",function(t){this.value;var a,n=t.which;return-1!==[s].indexOf(n)&&v.enterLikeTab?(a=e("input:visible,textarea:visible"),M.trigger("close.xdsoft"),a.eq(a.index(this)+1).focus(),!1):-1!==[f].indexOf(n)?(M.trigger("close.xdsoft"),!0):void 0})},r=function(t){var a=t.data("xdsoft_datetimepicker");a&&(a.data("xdsoft_datetime",null),a.remove(),t.data("xdsoft_datetimepicker",null).off(".xdsoft"),e(window).off("resize.xdsoft"),e([window,document.body]).off("mousedown.xdsoft"),t.unmousewheel&&t.unmousewheel())},e(document).off("keydown.xdsoftctrl keyup.xdsoftctrl").on("keydown.xdsoftctrl",function(e){e.keyCode===o&&(x=!0)}).on("keyup.xdsoftctrl",function(e){e.keyCode===o&&(x=!1)}),this.each(function(){var t=e(this).data("xdsoft_datetimepicker");if(t){if("string"===e.type(a))switch(a){case"show":e(this).select().focus(),t.trigger("open.xdsoft");break;case"hide":t.trigger("close.xdsoft");break;case"toggle":t.trigger("toggle.xdsoft");break;case"destroy":r(e(this));break;case"reset":this.value=this.defaultValue,this.value&&t.data("xdsoft_datetime").isValidDate(Date.parseDate(this.value,v.format))||t.data("changed",!1),t.data("xdsoft_datetime").setCurrentTime(this.value);break;case"validate":t.data("input").trigger("blur.xdsoft")}else t.setOptions(a);return 0}"string"!==e.type(a)&&(!v.lazyInit||v.open||v.inline?n(e(this)):function(e){e.on("open.xdsoft focusin.xdsoft mousedown.xdsoft",function t(a){e.is(":disabled")||e.data("xdsoft_datetimepicker")||(clearTimeout(b),b=setTimeout(function(){e.data("xdsoft_datetimepicker")||n(e),e.off("open.xdsoft focusin.xdsoft mousedown.xdsoft",t).trigger("open.xdsoft")},100))})}(e(this)))})},e.fn.datetimepicker.defaults=t}(jQuery),function(){!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e:e(jQuery)}(function(e){function t(t){var s=t||window.event,i=u.call(arguments,1),d=0,c=0,f=0,m=0,h=0,g=0;if(t=e.event.fix(s),t.type="mousewheel","detail"in s&&(f=-1*s.detail),"wheelDelta"in s&&(f=s.wheelDelta),"wheelDeltaY"in s&&(f=s.wheelDeltaY),"wheelDeltaX"in s&&(c=-1*s.wheelDeltaX),"axis"in s&&s.axis===s.HORIZONTAL_AXIS&&(c=-1*f,f=0),d=0===f?c:f,"deltaY"in s&&(f=-1*s.deltaY,d=f),"deltaX"in s&&(c=s.deltaX,0===f&&(d=-1*c)),0!==f||0!==c){if(1===s.deltaMode){var p=e.data(this,"mousewheel-line-height");d*=p,f*=p,c*=p}else if(2===s.deltaMode){var D=e.data(this,"mousewheel-page-height");d*=D,f*=D,c*=D}if(m=Math.max(Math.abs(f),Math.abs(c)),(!o||o>m)&&(o=m,n(s,m)&&(o/=40)),n(s,m)&&(d/=40,c/=40,f/=40),d=Math[d>=1?"floor":"ceil"](d/o),c=Math[c>=1?"floor":"ceil"](c/o),f=Math[f>=1?"floor":"ceil"](f/o),l.settings.normalizeOffset&&this.getBoundingClientRect){var y=this.getBoundingClientRect();h=t.clientX-y.left,g=t.clientY-y.top}return t.deltaX=c,t.deltaY=f,t.deltaFactor=o,t.offsetX=h,t.offsetY=g,t.deltaMode=0,i.unshift(t,d,c,f),r&&clearTimeout(r),r=setTimeout(a,200),(e.event.dispatch||e.event.handle).apply(this,i)}}function a(){o=null}function n(e,t){return l.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120==0}var r,o,s=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],i="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],u=Array.prototype.slice;if(e.event.fixHooks)for(var d=s.length;d;)e.event.fixHooks[s[--d]]=e.event.mouseHooks;var l=e.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var a=i.length;a;)this.addEventListener(i[--a],t,!1);else this.onmousewheel=t;e.data(this,"mousewheel-line-height",l.getLineHeight(this)),e.data(this,"mousewheel-page-height",l.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var a=i.length;a;)this.removeEventListener(i[--a],t,!1);else this.onmousewheel=null;e.removeData(this,"mousewheel-line-height"),e.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var a=e(t),n=a["offsetParent"in e.fn?"offsetParent":"parent"]();return n.length||(n=e("body")),parseInt(n.css("fontSize"),10)||parseInt(a.css("fontSize"),10)||16},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}),Date.parseFunctions={count:0},Date.parseRegexes=[],Date.formatFunctions={count:0},Date.prototype.dateFormat=function(e){if("unixtime"==e)return parseInt(this.getTime()/1e3);null==Date.formatFunctions[e]&&Date.createNewFormat(e);return this[Date.formatFunctions[e]]()},Date.createNewFormat=function(format){var funcName="format"+Date.formatFunctions.count++;Date.formatFunctions[format]=funcName;for(var codePrefix="Date.prototype."+funcName+" = function() {return ",code="",special=!1,ch="",i=0;i<format.length;++i)ch=format.charAt(i),special||"\\"!=ch?special?(special=!1,code+="'"+String.escape(ch)+"' + "):code+=Date.getFormatCode(ch):special=!0;code=0==code.length?'""':code.substring(0,code.length-3),eval(codePrefix+code+";}")},Date.getFormatCode=function(e){switch(e){case"d":return"String.leftPad(this.getDate(), 2, '0') + ";case"D":return"Date.dayNames[this.getDay()].substring(0, 3) + ";case"j":return"this.getDate() + ";case"l":return"Date.dayNames[this.getDay()] + ";case"S":return"this.getSuffix() + ";case"w":return"this.getDay() + ";case"z":return"this.getDayOfYear() + ";case"W":return"this.getWeekOfYear() + ";case"F":return"Date.monthNames[this.getMonth()] + ";case"m":return"String.leftPad(this.getMonth() + 1, 2, '0') + ";case"M":return"Date.monthNames[this.getMonth()].substring(0, 3) + ";case"n":return"(this.getMonth() + 1) + ";case"t":return"this.getDaysInMonth() + ";case"L":return"(this.isLeapYear() ? 1 : 0) + ";case"Y":return"this.getFullYear() + ";case"y":return"('' + this.getFullYear()).substring(2, 4) + ";case"a":return"(this.getHours() < 12 ? 'am' : 'pm') + ";case"A":return"(this.getHours() < 12 ? 'AM' : 'PM') + ";case"g":return"((this.getHours() %12) ? this.getHours() % 12 : 12) + ";case"G":return"this.getHours() + ";case"h":return"String.leftPad((this.getHours() %12) ? this.getHours() % 12 : 12, 2, '0') + ";case"H":return"String.leftPad(this.getHours(), 2, '0') + ";case"i":return"String.leftPad(this.getMinutes(), 2, '0') + ";case"s":return"String.leftPad(this.getSeconds(), 2, '0') + ";case"O":return"this.getGMTOffset() + ";case"T":return"this.getTimezone() + ";case"Z":return"(this.getTimezoneOffset() * -60) + ";default:return"'"+String.escape(e)+"' + "}},Date.parseDate=function(e,t){if("unixtime"==t)return new Date(isNaN(parseInt(e))?0:1e3*parseInt(e));null==Date.parseFunctions[t]&&Date.createParser(t);var a=Date.parseFunctions[t];return Date[a](e)},Date.createParser=function(format){var funcName="parse"+Date.parseFunctions.count++,regexNum=Date.parseRegexes.length,currentGroup=1;Date.parseFunctions[format]=funcName;for(var code="Date."+funcName+" = function(input) {\nvar y = -1, m = -1, d = -1, h = -1, i = -1, s = -1, z = -1;\nvar d = new Date();\ny = d.getFullYear();\nm = d.getMonth();\nd = d.getDate();\nvar results = input.match(Date.parseRegexes["+regexNum+"]);\nif (results && results.length > 0) {",regex="",special=!1,ch="",i=0;i<format.length;++i)ch=format.charAt(i),special||"\\"!=ch?special?(special=!1,regex+=String.escape(ch)):(obj=Date.formatCodeToRegex(ch,currentGroup),currentGroup+=obj.g,regex+=obj.s,obj.g&&obj.c&&(code+=obj.c)):special=!0;code+="if (y > 0 && z > 0){\nvar doyDate = new Date(y,0);\ndoyDate.setDate(z);\nm = doyDate.getMonth();\nd = doyDate.getDate();\n}",code+="if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0)\n{return new Date(y, m, d, h, i, s);}\nelse if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0)\n{return new Date(y, m, d, h, i);}\nelse if (y > 0 && m >= 0 && d > 0 && h >= 0)\n{return new Date(y, m, d, h);}\nelse if (y > 0 && m >= 0 && d > 0)\n{return new Date(y, m, d);}\nelse if (y > 0 && m >= 0)\n{return new Date(y, m);}\nelse if (y > 0)\n{return new Date(y);}\n}return null;}",Date.parseRegexes[regexNum]=new RegExp("^"+regex+"$","i"),eval(code)},Date.formatCodeToRegex=function(e,t){switch(e){case"D":return{g:0,c:null,s:"(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)"};case"j":case"d":return{g:1,c:"d = parseInt(results["+t+"], 10);\n",s:"(\\d{1,2})"};case"l":return{g:0,c:null,s:"(?:"+Date.dayNames.join("|")+")"};case"S":return{g:0,c:null,s:"(?:st|nd|rd|th)"};case"w":return{g:0,c:null,s:"\\d"};case"z":return{g:1,c:"z = parseInt(results["+t+"], 10);\n",s:"(\\d{1,3})"};case"W":return{g:0,c:null,s:"(?:\\d{2})"};case"F":return{g:1,c:"m = parseInt(Date.monthNumbers[results["+t+"].substring(0, 3)], 10);\n",s:"("+Date.monthNames.join("|")+")"};case"M":return{g:1,c:"m = parseInt(Date.monthNumbers[results["+t+"]], 10);\n",s:"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"};case"n":case"m":return{g:1,c:"m = parseInt(results["+t+"], 10) - 1;\n",s:"(\\d{1,2})"};case"t":return{g:0,c:null,s:"\\d{1,2}"};case"L":return{g:0,c:null,s:"(?:1|0)"};case"Y":return{g:1,c:"y = parseInt(results["+t+"], 10);\n",s:"(\\d{4})"};case"y":return{g:1,c:"var ty = parseInt(results["+t+"], 10);\ny = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"};case"a":return{g:1,c:"if (results["+t+"] == 'am') {\nif (h == 12) { h = 0; }\n} else { if (h < 12) { h += 12; }}",s:"(am|pm)"};case"A":return{g:1,c:"if (results["+t+"] == 'AM') {\nif (h == 12) { h = 0; }\n} else { if (h < 12) { h += 12; }}",s:"(AM|PM)"};case"g":case"G":case"h":case"H":return{g:1,c:"h = parseInt(results["+t+"], 10);\n",s:"(\\d{1,2})"};case"i":return{g:1,c:"i = parseInt(results["+t+"], 10);\n",s:"(\\d{2})"};case"s":return{g:1,c:"s = parseInt(results["+t+"], 10);\n",s:"(\\d{2})"};case"O":return{g:0,c:null,s:"[+-]\\d{4}"};case"T":return{g:0,c:null,s:"[A-Z]{3}"};case"Z":return{g:0,c:null,s:"[+-]\\d{1,5}"};default:return{g:0,c:null,s:String.escape(e)}}},Date.prototype.getTimezone=function(){return this.toString().replace(/^.*? ([A-Z]{3}) [0-9]{4}.*$/,"$1").replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/,"$1$2$3")},Date.prototype.getGMTOffset=function(){return(this.getTimezoneOffset()>0?"-":"+")+String.leftPad(Math.floor(Math.abs(this.getTimezoneOffset())/60),2,"0")+String.leftPad(Math.abs(this.getTimezoneOffset())%60,2,"0")},Date.prototype.getDayOfYear=function(){var e=0;Date.daysInMonth[1]=this.isLeapYear()?29:28;for(var t=0;t<this.getMonth();++t)e+=Date.daysInMonth[t];return e+this.getDate()},Date.prototype.getWeekOfYear=function(){var e=this.getDayOfYear()+(4-this.getDay()),t=7-new Date(this.getFullYear(),0,1).getDay()+4;return String.leftPad(Math.ceil((e-t)/7)+1,2,"0")},Date.prototype.isLeapYear=function(){var e=this.getFullYear();return 0==(3&e)&&(e%100||e%400==0&&e)},Date.prototype.getFirstDayOfMonth=function(){var e=(this.getDay()-(this.getDate()-1))%7;return e<0?e+7:e},Date.prototype.getLastDayOfMonth=function(){var e=(this.getDay()+(Date.daysInMonth[this.getMonth()]-this.getDate()))%7;return e<0?e+7:e},Date.prototype.getDaysInMonth=function(){return Date.daysInMonth[1]=this.isLeapYear()?29:28,Date.daysInMonth[this.getMonth()]},Date.prototype.getSuffix=function(){switch(this.getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th"}},String.escape=function(e){return e.replace(/('|\\)/g,"\\$1")},String.leftPad=function(e,t,a){var n=new String(e);for(null==a&&(a=" ");n.length<t;)n=a+n;return n},Date.daysInMonth=[31,28,31,30,31,30,31,31,30,31,30,31],Date.monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"],Date.dayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Date.y2kYear=50,Date.monthNumbers={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11},Date.patterns={ISO8601LongPattern:"Y-m-d H:i:s",ISO8601ShortPattern:"Y-m-d",ShortDatePattern:"n/j/Y",LongDatePattern:"l, F d, Y",FullDateTimePattern:"l, F d, Y g:i:s A",MonthDayPattern:"F d",ShortTimePattern:"g:i A",LongTimePattern:"g:i:s A",SortableDateTimePattern:"Y-m-d\\TH:i:s",UniversalSortableDateTimePattern:"Y-m-d H:i:sO",YearMonthPattern:"F, Y"}}();