mirror of
https://github.com/xdan/datetimepicker.git
synced 2024-11-18 06:24:22 +00:00
d409dfa212
UI FIXME: if you are on the day with the minDateTime/maxDateTime limit and your timebox lists only the times according to the limit, when you click on another day, the timebox is populated with all the newly allowed times, but the scrollbar does not update, so you cannot scroll to them using the scroll bar. if you click again on a day (any day), the scrollbar is updated correctly and you can select all times from the timebox again
1 line
50 KiB
JavaScript
1 line
50 KiB
JavaScript
var datetimepickerFactory=function(q){"use strict";var s={i18n:{ar:{months:["كانون الثاني","شباط","آذار","نيسان","مايو","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول"],dayOfWeekShort:["ن","ث","ع","خ","ج","س","ح"],dayOfWeek:["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت","الأحد"]},ro:{months:["Ianuarie","Februarie","Martie","Aprilie","Mai","Iunie","Iulie","August","Septembrie","Octombrie","Noiembrie","Decembrie"],dayOfWeekShort:["Du","Lu","Ma","Mi","Jo","Vi","Sâ"],dayOfWeek:["Duminică","Luni","Marţi","Miercuri","Joi","Vineri","Sâmbătă"]},id:{months:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],dayOfWeekShort:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],dayOfWeek:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"]},is:{months:["Janúar","Febrúar","Mars","Apríl","Maí","Júní","Júlí","Ágúst","September","Október","Nóvember","Desember"],dayOfWeekShort:["Sun","Mán","Þrið","Mið","Fim","Fös","Lau"],dayOfWeek:["Sunnudagur","Mánudagur","Þriðjudagur","Miðvikudagur","Fimmtudagur","Föstudagur","Laugardagur"]},bg:{months:["Януари","Февруари","Март","Април","Май","Юни","Юли","Август","Септември","Октомври","Ноември","Декември"],dayOfWeekShort:["Нд","Пн","Вт","Ср","Чт","Пт","Сб"],dayOfWeek:["Неделя","Понеделник","Вторник","Сряда","Четвъртък","Петък","Събота"]},fa:{months:["فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذر","دی","بهمن","اسفند"],dayOfWeekShort:["یکشنبه","دوشنبه","سه شنبه","چهارشنبه","پنجشنبه","جمعه","شنبه"],dayOfWeek:["یکشنبه","دوشنبه","سهشنبه","چهارشنبه","پنجشنبه","جمعه","شنبه","یکشنبه"]},ru:{months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],dayOfWeekShort:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],dayOfWeek:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"]},uk:{months:["Січень","Лютий","Березень","Квітень","Травень","Червень","Липень","Серпень","Вересень","Жовтень","Листопад","Грудень"],dayOfWeekShort:["Ндл","Пнд","Втр","Срд","Чтв","Птн","Сбт"],dayOfWeek:["Неділя","Понеділок","Вівторок","Середа","Четвер","П'ятниця","Субота"]},en:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],dayOfWeekShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},el:{months:["Ιανουάριος","Φεβρουάριος","Μάρτιος","Απρίλιος","Μάιος","Ιούνιος","Ιούλιος","Αύγουστος","Σεπτέμβριος","Οκτώβριος","Νοέμβριος","Δεκέμβριος"],dayOfWeekShort:["Κυρ","Δευ","Τρι","Τετ","Πεμ","Παρ","Σαβ"],dayOfWeek:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"]},de:{months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],dayOfWeekShort:["So","Mo","Di","Mi","Do","Fr","Sa"],dayOfWeek:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]},nl:{months:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],dayOfWeekShort:["zo","ma","di","wo","do","vr","za"],dayOfWeek:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"]},tr:{months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],dayOfWeekShort:["Paz","Pts","Sal","Çar","Per","Cum","Cts"],dayOfWeek:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"]},fr:{months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],dayOfWeekShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],dayOfWeek:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]},es:{months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],dayOfWeekShort:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb"],dayOfWeek:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"]},th:{months:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],dayOfWeekShort:["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."],dayOfWeek:["อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัส","ศุกร์","เสาร์","อาทิตย์"]},pl:{months:["styczeń","luty","marzec","kwiecień","maj","czerwiec","lipiec","sierpień","wrzesień","październik","listopad","grudzień"],dayOfWeekShort:["nd","pn","wt","śr","cz","pt","sb"],dayOfWeek:["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"]},pt:{months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],dayOfWeekShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sab"],dayOfWeek:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"]},ch:{months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayOfWeekShort:["日","一","二","三","四","五","六"]},se:{months:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],dayOfWeekShort:["Sön","Mån","Tis","Ons","Tor","Fre","Lör"]},km:{months:["មករា","កុម្ភៈ","មិនា","មេសា","ឧសភា","មិថុនា","កក្កដា","សីហា","កញ្ញា","តុលា","វិច្ឆិកា","ធ្នូ"],dayOfWeekShort:["អាទិ","ច័ន្ទ","អង្គារ","ពុធ","ព្រហ","សុក្រ","សៅរ៍"],dayOfWeek:["អាទិត្យ","ច័ន្ទ","អង្គារ","ពុធ","ព្រហស្បតិ៍","សុក្រ","សៅរ៍"]},kr:{months:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],dayOfWeekShort:["일","월","화","수","목","금","토"],dayOfWeek:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"]},it:{months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],dayOfWeekShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],dayOfWeek:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"]},da:{months:["Januar","Februar","Marts","April","Maj","Juni","Juli","August","September","Oktober","November","December"],dayOfWeekShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør"],dayOfWeek:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"]},no:{months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],dayOfWeekShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør"],dayOfWeek:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag"]},ja:{months:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeekShort:["日","月","火","水","木","金","土"],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"],dayOfWeekShort:["CN","T2","T3","T4","T5","T6","T7"],dayOfWeek:["Chủ nhật","Thứ hai","Thứ ba","Thứ tư","Thứ năm","Thứ sáu","Thứ bảy"]},sl:{months:["Januar","Februar","Marec","April","Maj","Junij","Julij","Avgust","September","Oktober","November","December"],dayOfWeekShort:["Ned","Pon","Tor","Sre","Čet","Pet","Sob"],dayOfWeek:["Nedelja","Ponedeljek","Torek","Sreda","Četrtek","Petek","Sobota"]},cs:{months:["Leden","Únor","Březen","Duben","Květen","Červen","Červenec","Srpen","Září","Říjen","Listopad","Prosinec"],dayOfWeekShort:["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"],dayOfWeekShort:["Va","Hé","Ke","Sze","Cs","Pé","Szo"],dayOfWeek:["vasárnap","hétfő","kedd","szerda","csütörtök","péntek","szombat"]},az:{months:["Yanvar","Fevral","Mart","Aprel","May","Iyun","Iyul","Avqust","Sentyabr","Oktyabr","Noyabr","Dekabr"],dayOfWeekShort:["B","Be","Ça","Ç","Ca","C","Ş"],dayOfWeek:["Bazar","Bazar ertəsi","Çərşənbə axşamı","Çərşənbə","Cümə axşamı","Cümə","Şənbə"]},bs:{months:["Januar","Februar","Mart","April","Maj","Jun","Jul","Avgust","Septembar","Oktobar","Novembar","Decembar"],dayOfWeekShort:["Ned","Pon","Uto","Sri","Čet","Pet","Sub"],dayOfWeek:["Nedjelja","Ponedjeljak","Utorak","Srijeda","Četvrtak","Petak","Subota"]},ca:{months:["Gener","Febrer","Març","Abril","Maig","Juny","Juliol","Agost","Setembre","Octubre","Novembre","Desembre"],dayOfWeekShort:["Dg","Dl","Dt","Dc","Dj","Dv","Ds"],dayOfWeek:["Diumenge","Dilluns","Dimarts","Dimecres","Dijous","Divendres","Dissabte"]},"en-GB":{months:["January","February","March","April","May","June","July","August","September","October","November","December"],dayOfWeekShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},et:{months:["Jaanuar","Veebruar","Märts","Aprill","Mai","Juuni","Juuli","August","September","Oktoober","November","Detsember"],dayOfWeekShort:["P","E","T","K","N","R","L"],dayOfWeek:["Pühapäev","Esmaspäev","Teisipäev","Kolmapäev","Neljapäev","Reede","Laupäev"]},eu:{months:["Urtarrila","Otsaila","Martxoa","Apirila","Maiatza","Ekaina","Uztaila","Abuztua","Iraila","Urria","Azaroa","Abendua"],dayOfWeekShort:["Ig.","Al.","Ar.","Az.","Og.","Or.","La."],dayOfWeek:["Igandea","Astelehena","Asteartea","Asteazkena","Osteguna","Ostirala","Larunbata"]},fi:{months:["Tammikuu","Helmikuu","Maaliskuu","Huhtikuu","Toukokuu","Kesäkuu","Heinäkuu","Elokuu","Syyskuu","Lokakuu","Marraskuu","Joulukuu"],dayOfWeekShort:["Su","Ma","Ti","Ke","To","Pe","La"],dayOfWeek:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai"]},gl:{months:["Xan","Feb","Maz","Abr","Mai","Xun","Xul","Ago","Set","Out","Nov","Dec"],dayOfWeekShort:["Dom","Lun","Mar","Mer","Xov","Ven","Sab"],dayOfWeek:["Domingo","Luns","Martes","Mércores","Xoves","Venres","Sábado"]},hr:{months:["Siječanj","Veljača","Ožujak","Travanj","Svibanj","Lipanj","Srpanj","Kolovoz","Rujan","Listopad","Studeni","Prosinac"],dayOfWeekShort:["Ned","Pon","Uto","Sri","Čet","Pet","Sub"],dayOfWeek:["Nedjelja","Ponedjeljak","Utorak","Srijeda","Četvrtak","Petak","Subota"]},ko:{months:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],dayOfWeekShort:["일","월","화","수","목","금","토"],dayOfWeek:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"]},lt:{months:["Sausio","Vasario","Kovo","Balandžio","Gegužės","Birželio","Liepos","Rugpjūčio","Rugsėjo","Spalio","Lapkričio","Gruodžio"],dayOfWeekShort:["Sek","Pir","Ant","Tre","Ket","Pen","Šeš"],dayOfWeek:["Sekmadienis","Pirmadienis","Antradienis","Trečiadienis","Ketvirtadienis","Penktadienis","Šeštadienis"]},lv:{months:["Janvāris","Februāris","Marts","Aprīlis ","Maijs","Jūnijs","Jūlijs","Augusts","Septembris","Oktobris","Novembris","Decembris"],dayOfWeekShort:["Sv","Pr","Ot","Tr","Ct","Pk","St"],dayOfWeek:["Svētdiena","Pirmdiena","Otrdiena","Trešdiena","Ceturtdiena","Piektdiena","Sestdiena"]},mk:{months:["јануари","февруари","март","април","мај","јуни","јули","август","септември","октомври","ноември","декември"],dayOfWeekShort:["нед","пон","вто","сре","чет","пет","саб"],dayOfWeek:["Недела","Понеделник","Вторник","Среда","Четврток","Петок","Сабота"]},mn:{months:["1-р сар","2-р сар","3-р сар","4-р сар","5-р сар","6-р сар","7-р сар","8-р сар","9-р сар","10-р сар","11-р сар","12-р сар"],dayOfWeekShort:["Дав","Мяг","Лха","Пүр","Бсн","Бям","Ням"],dayOfWeek:["Даваа","Мягмар","Лхагва","Пүрэв","Баасан","Бямба","Ням"]},"pt-BR":{months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],dayOfWeekShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],dayOfWeek:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"]},sk:{months:["Január","Február","Marec","Apríl","Máj","Jún","Júl","August","September","Október","November","December"],dayOfWeekShort:["Ne","Po","Ut","St","Št","Pi","So"],dayOfWeek:["Nedeľa","Pondelok","Utorok","Streda","Štvrtok","Piatok","Sobota"]},sq:{months:["Janar","Shkurt","Mars","Prill","Maj","Qershor","Korrik","Gusht","Shtator","Tetor","Nëntor","Dhjetor"],dayOfWeekShort:["Die","Hën","Mar","Mër","Enj","Pre","Shtu"],dayOfWeek:["E Diel","E Hënë","E Martē","E Mërkurë","E Enjte","E Premte","E Shtunë"]},"sr-YU":{months:["Januar","Februar","Mart","April","Maj","Jun","Jul","Avgust","Septembar","Oktobar","Novembar","Decembar"],dayOfWeekShort:["Ned","Pon","Uto","Sre","čet","Pet","Sub"],dayOfWeek:["Nedelja","Ponedeljak","Utorak","Sreda","Četvrtak","Petak","Subota"]},sr:{months:["јануар","фебруар","март","април","мај","јун","јул","август","септембар","октобар","новембар","децембар"],dayOfWeekShort:["нед","пон","уто","сре","чет","пет","суб"],dayOfWeek:["Недеља","Понедељак","Уторак","Среда","Четвртак","Петак","Субота"]},sv:{months:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],dayOfWeekShort:["Sön","Mån","Tis","Ons","Tor","Fre","Lör"],dayOfWeek:["Söndag","Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag"]},"zh-TW":{months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayOfWeekShort:["日","一","二","三","四","五","六"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},zh:{months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayOfWeekShort:["日","一","二","三","四","五","六"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},ug:{months:["1-ئاي","2-ئاي","3-ئاي","4-ئاي","5-ئاي","6-ئاي","7-ئاي","8-ئاي","9-ئاي","10-ئاي","11-ئاي","12-ئاي"],dayOfWeek:["يەكشەنبە","دۈشەنبە","سەيشەنبە","چارشەنبە","پەيشەنبە","جۈمە","شەنبە"]},he:{months:["ינואר","פברואר","מרץ","אפריל","מאי","יוני","יולי","אוגוסט","ספטמבר","אוקטובר","נובמבר","דצמבר"],dayOfWeekShort:["א'","ב'","ג'","ד'","ה'","ו'","שבת"],dayOfWeek:["ראשון","שני","שלישי","רביעי","חמישי","שישי","שבת","ראשון"]},hy:{months:["Հունվար","Փետրվար","Մարտ","Ապրիլ","Մայիս","Հունիս","Հուլիս","Օգոստոս","Սեպտեմբեր","Հոկտեմբեր","Նոյեմբեր","Դեկտեմբեր"],dayOfWeekShort:["Կի","Երկ","Երք","Չոր","Հնգ","Ուրբ","Շբթ"],dayOfWeek:["Կիրակի","Երկուշաբթի","Երեքշաբթի","Չորեքշաբթի","Հինգշաբթի","Ուրբաթ","Շաբաթ"]},kg:{months:["Үчтүн айы","Бирдин айы","Жалган Куран","Чын Куран","Бугу","Кулжа","Теке","Баш Оона","Аяк Оона","Тогуздун айы","Жетинин айы","Бештин айы"],dayOfWeekShort:["Жек","Дүй","Шей","Шар","Бей","Жум","Ише"],dayOfWeek:["Жекшемб","Дүйшөмб","Шейшемб","Шаршемб","Бейшемби","Жума","Ишенб"]},rm:{months:["Schaner","Favrer","Mars","Avrigl","Matg","Zercladur","Fanadur","Avust","Settember","October","November","December"],dayOfWeekShort:["Du","Gli","Ma","Me","Gie","Ve","So"],dayOfWeek:["Dumengia","Glindesdi","Mardi","Mesemna","Gievgia","Venderdi","Sonda"]},ka:{months:["იანვარი","თებერვალი","მარტი","აპრილი","მაისი","ივნისი","ივლისი","აგვისტო","სექტემბერი","ოქტომბერი","ნოემბერი","დეკემბერი"],dayOfWeekShort:["კვ","ორშ","სამშ","ოთხ","ხუთ","პარ","შაბ"],dayOfWeek:["კვირა","ორშაბათი","სამშაბათი","ოთხშაბათი","ხუთშაბათი","პარასკევი","შაბათი"]}},ownerDocument:document,contentWindow:window,value:"",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,openOnFocus:!0,timepicker:!0,datepicker:!0,weeks:!1,defaultTime:!1,defaultDate:!1,minDate:!1,maxDate:!1,minTime:!1,maxTime:!1,minDateTime:!1,maxDateTime:!1,allowTimes:[],opened:!1,initTime:!0,inline:!1,theme:"",touchMovedThreshold:5,onSelectDate:function(){},onSelectTime:function(){},onChangeMonth:function(){},onGetWeekOfYear: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:[],allowDates:[],allowDateRe:null,disabledDates:[],disabledWeekDays:[],yearOffset:0,beforeShowDay:null,enterLikeTab:!0,showApplyButton:!1},K=null,o=null,U="en",a={meridiem:["AM","PM"]},r=function(){var e=s.i18n[U],t={days:e.dayOfWeek,daysShort:e.dayOfWeekShort,months:e.months,monthsShort:q.map(e.months,function(e){return e.substring(0,3)})};"function"==typeof DateFormatter&&(K=o=new DateFormatter({dateSettings:q.extend({},a,t)}))},n={moment:{default_options:{format:"YYYY/MM/DD HH:mm",formatDate:"YYYY/MM/DD",formatTime:"HH:mm"},formatter:{parseDate:function(e,t){if(i(t))return o.parseDate(e,t);var a=moment(e,t);return!!a.isValid()&&a.toDate()},formatDate:function(e,t){return i(t)?o.formatDate(e,t):moment(e).format(t)},formatMask:function(e){return e.replace(/Y{4}/g,"9999").replace(/Y{2}/g,"99").replace(/M{2}/g,"19").replace(/D{2}/g,"39").replace(/H{2}/g,"29").replace(/m{2}/g,"59").replace(/s{2}/g,"59")}}}};q.datetimepicker={setLocale:function(e){var t=s.i18n[e]?e:"en";U!==t&&(U=t,r())},setDateFormatter:function(e){if("string"==typeof e&&n.hasOwnProperty(e)){var t=n[e];q.extend(s,t.default_options),K=t.formatter}else K=e}};var t={RFC_2822:"D, d M Y H:i:s O",ATOM:"Y-m-dTH:i:sP",ISO_8601:"Y-m-dTH:i:sO",RFC_822:"D, d M y H:i:s O",RFC_850:"l, d-M-y H:i:s T",RFC_1036:"D, d M y H:i:s O",RFC_1123:"D, d M Y H:i:s O",RSS:"D, d M Y H:i:s O",W3C:"Y-m-dTH:i:sP"},i=function(e){return-1!==Object.values(t).indexOf(e)};function m(e,t,a){this.date=e,this.desc=t,this.style=a}q.extend(q.datetimepicker,t),r(),window.getComputedStyle||(window.getComputedStyle=function(a){return this.el=a,this.getPropertyValue=function(e){var t=/(-([a-z]))/g;return"float"===e&&(e="styleFloat"),t.test(e)&&(e=e.replace(t,function(e,t,a){return a.toUpperCase()})),a.currentStyle[e]||null},this}),Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){var a,o;for(a=t||0,o=this.length;a<o;a+=1)if(this[a]===e)return a;return-1}),Date.prototype.countDaysInMonth=function(){return new Date(this.getFullYear(),this.getMonth()+1,0).getDate()},q.fn.xdsoftScroller=function(p,D){return this.each(function(){var n,i,s,d,u,l=q(this),a=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},f=100,o=!1,r=0,c=0,m=0,t=!1,h=0,g=function(){};"hide"!==D?(q(this).hasClass("xdsoft_scroller_box")||(n=l.children().eq(0),i=l[0].clientHeight,s=n[0].offsetHeight,d=q('<div class="xdsoft_scrollbar"></div>'),u=q('<div class="xdsoft_scroller"></div>'),d.append(u),l.addClass("xdsoft_scroller_box").append(d),g=function(e){var t=a(e).y-r+h;t<0&&(t=0),t+u[0].offsetHeight>m&&(t=m-u[0].offsetHeight),l.trigger("scroll_element.xdsoft_scroller",[f?t/f:0])},u.on("touchstart.xdsoft_scroller mousedown.xdsoft_scroller",function(e){i||l.trigger("resize_scroll.xdsoft_scroller",[D]),r=a(e).y,h=parseInt(u.css("margin-top"),10),m=d[0].offsetHeight,"mousedown"===e.type||"touchstart"===e.type?(p.ownerDocument&&q(p.ownerDocument.body).addClass("xdsoft_noselect"),q([p.ownerDocument.body,p.contentWindow]).on("touchend mouseup.xdsoft_scroller",function e(){q([p.ownerDocument.body,p.contentWindow]).off("touchend mouseup.xdsoft_scroller",e).off("mousemove.xdsoft_scroller",g).removeClass("xdsoft_noselect")}),q(p.ownerDocument.body).on("mousemove.xdsoft_scroller",g)):(t=!0,e.stopPropagation(),e.preventDefault())}).on("touchmove",function(e){t&&(e.preventDefault(),g(e))}).on("touchend touchcancel",function(){t=!1,h=0}),l.on("scroll_element.xdsoft_scroller",function(e,t){i||l.trigger("resize_scroll.xdsoft_scroller",[t,!0]),t=1<t?1:t<0||isNaN(t)?0:t,u.css("margin-top",f*t),setTimeout(function(){n.css("marginTop",-parseInt((n[0].offsetHeight-i)*t,10))},10)}).on("resize_scroll.xdsoft_scroller",function(e,t,a){var o,r;i=l[0].clientHeight,s=n[0].offsetHeight,r=(o=i/s)*d[0].offsetHeight,1<o?u.hide():(u.show(),u.css("height",parseInt(10<r?r:10,10)),f=d[0].offsetHeight-u[0].offsetHeight,!0!==a&&l.trigger("scroll_element.xdsoft_scroller",[t||Math.abs(parseInt(n.css("marginTop"),10))/(s-i)]))}),l.on("mousewheel",function(e){var t=Math.abs(parseInt(n.css("marginTop"),10));return(t-=20*e.deltaY)<0&&(t=0),l.trigger("scroll_element.xdsoft_scroller",[t/(s-i)]),e.stopPropagation(),!1}),l.on("touchstart",function(e){o=a(e),c=Math.abs(parseInt(n.css("marginTop"),10))}),l.on("touchmove",function(e){if(o){e.preventDefault();var t=a(e);l.trigger("scroll_element.xdsoft_scroller",[(c-(t.y-o.y))/(s-i)])}}),l.on("touchend touchcancel",function(){o=!1,c=0})),l.trigger("resize_scroll.xdsoft_scroller",[D])):l.find(".xdsoft_scrollbar").hide()})},q.fn.datetimepicker=function(j,a){var o,r,n=this,p=48,D=57,y=96,k=105,v=17,x=46,b=13,T=27,S=8,O=37,M=38,H=39,J=40,z=9,N=116,I=65,L=67,E=86,V=90,R=89,B=!1,G=q.isPlainObject(j)||!j?q.extend(!0,{},s,j):q.extend(!0,{},s),i=0;return o=function(w){var t,o,a,r,W,h,_=q('<div class="xdsoft_datetimepicker xdsoft_noselect"></div>'),e=q('<div class="xdsoft_copyright"><a target="_blank" href="http://xdsoft.net/jqplugins/datetimepicker/">xdsoft.net</a></div>'),g=q('<div class="xdsoft_datepicker active"></div>'),F=q('<div class="xdsoft_monthpicker"><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>'),C=q('<div class="xdsoft_calendar"></div>'),n=q('<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>'),u=n.find(".xdsoft_time_box").eq(0),P=q('<div class="xdsoft_time_variant"></div>'),i=q('<button type="button" class="xdsoft_save_selected blue-gradient-button">Save Selected</button>'),A=q('<div class="xdsoft_select xdsoft_monthselect"><div></div></div>'),Y=q('<div class="xdsoft_select xdsoft_yearselect"><div></div></div>'),s=!1,d=0;G.id&&_.attr("id",G.id),G.style&&_.attr("style",G.style),G.weeks&&_.addClass("xdsoft_showweeks"),G.rtl&&_.addClass("xdsoft_rtl"),_.addClass("xdsoft_"+G.theme),_.addClass(G.className),F.find(".xdsoft_month span").after(A),F.find(".xdsoft_year span").after(Y),F.find(".xdsoft_month,.xdsoft_year").on("touchstart mousedown.xdsoft",function(e){var t,a,o=q(this).find(".xdsoft_select").eq(0),r=0,n=0,i=o.is(":visible");for(F.find(".xdsoft_select").hide(),W.currentTime&&(r=W.currentTime[q(this).hasClass("xdsoft_month")?"getMonth":"getFullYear"]()),o[i?"hide":"show"](),t=o.find("div.xdsoft_option"),a=0;a<t.length&&t.eq(a).data("value")!==r;a+=1)n+=t[0].offsetHeight;return o.xdsoftScroller(G,n/(o.children()[0].offsetHeight-o[0].clientHeight)),e.stopPropagation(),!1});var l=function(e){this.touchStartPosition=this.touchStartPosition||e.originalEvent.touches[0];var t=e.originalEvent.touches[0],a=Math.abs(this.touchStartPosition.clientX-t.clientX),o=Math.abs(this.touchStartPosition.clientY-t.clientY);Math.sqrt(a*a+o*o)>G.touchMovedThreshold&&(this.touchMoved=!0)};function f(){var e,t=!1;return G.startDate?t=W.strToDate(G.startDate):(t=G.value||(w&&w.val&&w.val()?w.val():""))?(t=W.strToDateTime(t),G.yearOffset&&(t=new Date(t.getFullYear()-G.yearOffset,t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))):G.defaultDate&&(t=W.strToDateTime(G.defaultDate),G.defaultTime&&(e=W.strtotime(G.defaultTime),t.setHours(e.getHours()),t.setMinutes(e.getMinutes()))),t&&W.isValidDate(t)?_.data("changed",!0):t="",t||0}function c(m){var h=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)},g=function(e,t){if(!(e="string"==typeof e||e instanceof String?m.ownerDocument.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}return!!e.setSelectionRange&&(e.setSelectionRange(t,t),!0)};m.mask&&w.off("keydown.xdsoft"),!0===m.mask&&(K.formatMask?m.mask=K.formatMask(m.format):m.mask=m.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"===q.type(m.mask)&&(h(m.mask,w.val())||(w.val(m.mask.replace(/[0-9]/g,"_")),g(w[0],0)),w.on("paste.xdsoft",function(e){var t=(e.clipboardData||e.originalEvent.clipboardData||window.clipboardData).getData("text"),a=this.value,o=this.selectionStart;return a=a.substr(0,o)+t+a.substr(o+t.length),o+=t.length,h(m.mask,a)?(this.value=a,g(this,o)):""===q.trim(a)?this.value=m.mask.replace(/[0-9]/g,"_"):w.trigger("error_input.xdsoft"),e.preventDefault(),!1}),w.on("keydown.xdsoft",function(e){var t,a=this.value,o=e.which,r=this.selectionStart,n=this.selectionEnd,i=r!==n;if(p<=o&&o<=D||y<=o&&o<=k||o===S||o===x){for(t=o===S||o===x?"_":String.fromCharCode(y<=o&&o<=k?o-p:o),o===S&&r&&!i&&(r-=1);;){var s=m.mask.substr(r,1),d=r<m.mask.length,u=0<r;if(!(/[^0-9_]/.test(s)&&d&&u))break;r+=o!==S||i?1:-1}if(i){var l=n-r,f=m.mask.replace(/[0-9]/g,"_"),c=f.substr(r,l).substr(1);a=a.substr(0,r)+(t+c)+a.substr(r+l)}else{a=a.substr(0,r)+t+a.substr(r+1)}if(""===q.trim(a))a=f;else if(r===m.mask.length)return e.preventDefault(),!1;for(r+=o===S?0:1;/[^0-9_]/.test(m.mask.substr(r,1))&&r<m.mask.length&&0<r;)r+=o===S?0:1;h(m.mask,a)?(this.value=a,g(this,r)):""===q.trim(a)?this.value=m.mask.replace(/[0-9]/g,"_"):w.trigger("error_input.xdsoft")}else if(-1!==[I,L,E,V,R].indexOf(o)&&B||-1!==[T,M,J,O,H,N,v,z,b].indexOf(o))return!0;return e.preventDefault(),!1}))}F.find(".xdsoft_select").xdsoftScroller(G).on("touchstart mousedown.xdsoft",function(e){this.touchMoved=!1,this.touchStartPosition=e.originalEvent.touches[0],e.stopPropagation(),e.preventDefault()}).on("touchmove",".xdsoft_option",l).on("touchend mousedown.xdsoft",".xdsoft_option",function(){if(!this.touchMoved){void 0!==W.currentTime&&null!==W.currentTime||(W.currentTime=W.now());var e=W.currentTime.getFullYear();W&&W.currentTime&&W.currentTime[q(this).parent().parent().hasClass("xdsoft_monthselect")?"setMonth":"setFullYear"](q(this).data("value")),q(this).parent().parent().hide(),_.trigger("xchange.xdsoft"),G.onChangeMonth&&q.isFunction(G.onChangeMonth)&&G.onChangeMonth.call(_,W.currentTime,_.data("input")),e!==W.currentTime.getFullYear()&&q.isFunction(G.onChangeYear)&&G.onChangeYear.call(_,W.currentTime,_.data("input"))}}),_.getValue=function(){return W.getCurrentTime()},_.setOptions=function(e){var l={};G=q.extend(!0,{},G,e),e.allowTimes&&q.isArray(e.allowTimes)&&e.allowTimes.length&&(G.allowTimes=q.extend(!0,[],e.allowTimes)),e.weekends&&q.isArray(e.weekends)&&e.weekends.length&&(G.weekends=q.extend(!0,[],e.weekends)),e.allowDates&&q.isArray(e.allowDates)&&e.allowDates.length&&(G.allowDates=q.extend(!0,[],e.allowDates)),e.allowDateRe&&"[object String]"===Object.prototype.toString.call(e.allowDateRe)&&(G.allowDateRe=new RegExp(e.allowDateRe)),e.highlightedDates&&q.isArray(e.highlightedDates)&&e.highlightedDates.length&&(q.each(e.highlightedDates,function(e,t){var a,o=q.map(t.split(","),q.trim),r=new m(K.parseDate(o[0],G.formatDate),o[1],o[2]),n=K.formatDate(r.date,G.formatDate);void 0!==l[n]?(a=l[n].desc)&&a.length&&r.desc&&r.desc.length&&(l[n].desc=a+"\n"+r.desc):l[n]=r}),G.highlightedDates=q.extend(!0,[],l)),e.highlightedPeriods&&q.isArray(e.highlightedPeriods)&&e.highlightedPeriods.length&&(l=q.extend(!0,[],G.highlightedDates),q.each(e.highlightedPeriods,function(e,t){var a,o,r,n,i,s,d;if(q.isArray(t))a=t[0],o=t[1],r=t[2],d=t[3];else{var u=q.map(t.split(","),q.trim);a=K.parseDate(u[0],G.formatDate),o=K.parseDate(u[1],G.formatDate),r=u[2],d=u[3]}for(;a<=o;)n=new m(a,r,d),i=K.formatDate(a,G.formatDate),a.setDate(a.getDate()+1),void 0!==l[i]?(s=l[i].desc)&&s.length&&n.desc&&n.desc.length&&(l[i].desc=s+"\n"+n.desc):l[i]=n}),G.highlightedDates=q.extend(!0,[],l)),e.disabledDates&&q.isArray(e.disabledDates)&&e.disabledDates.length&&(G.disabledDates=q.extend(!0,[],e.disabledDates)),e.disabledWeekDays&&q.isArray(e.disabledWeekDays)&&e.disabledWeekDays.length&&(G.disabledWeekDays=q.extend(!0,[],e.disabledWeekDays)),!G.open&&!G.opened||G.inline||w.trigger("open.xdsoft"),G.inline&&(s=!0,_.addClass("xdsoft_inline"),w.after(_).hide()),G.inverseButton&&(G.next="xdsoft_prev",G.prev="xdsoft_next"),G.datepicker?g.addClass("active"):g.removeClass("active"),G.timepicker?n.addClass("active"):n.removeClass("active"),G.value&&(W.setCurrentTime(G.value),w&&w.val&&w.val(W.str)),isNaN(G.dayOfWeekStart)?G.dayOfWeekStart=0:G.dayOfWeekStart=parseInt(G.dayOfWeekStart,10)%7,G.timepickerScrollbar||u.xdsoftScroller(G,"hide"),G.minDate&&/^[\+\-](.*)$/.test(G.minDate)&&(G.minDate=K.formatDate(W.strToDateTime(G.minDate),G.formatDate)),G.maxDate&&/^[\+\-](.*)$/.test(G.maxDate)&&(G.maxDate=K.formatDate(W.strToDateTime(G.maxDate),G.formatDate)),G.minDateTime&&/^\+(.*)$/.test(G.minDateTime)&&(G.minDateTime=W.strToDateTime(G.minDateTime).dateFormat(G.formatDate)),G.maxDateTime&&/^\+(.*)$/.test(G.maxDateTime)&&(G.maxDateTime=W.strToDateTime(G.maxDateTime).dateFormat(G.formatDate)),i.toggle(G.showApplyButton),F.find(".xdsoft_today_button").css("visibility",G.todayButton?"visible":"hidden"),F.find("."+G.prev).css("visibility",G.prevButton?"visible":"hidden"),F.find("."+G.next).css("visibility",G.nextButton?"visible":"hidden"),c(G),G.validateOnBlur&&w.off("blur.xdsoft").on("blur.xdsoft",function(){if(G.allowBlank&&(!q.trim(q(this).val()).length||"string"==typeof G.mask&&q.trim(q(this).val())===G.mask.replace(/[0-9]/g,"_")))q(this).val(null),_.data("xdsoft_datetime").empty();else{var e=K.parseDate(q(this).val(),G.format);if(e)q(this).val(K.formatDate(e,G.format));else{var t=+[q(this).val()[0],q(this).val()[1]].join(""),a=+[q(this).val()[2],q(this).val()[3]].join("");!G.datepicker&&G.timepicker&&0<=t&&t<24&&0<=a&&a<60?q(this).val([t,a].map(function(e){return 9<e?e:"0"+e}).join(":")):q(this).val(K.formatDate(W.now(),G.format))}_.data("xdsoft_datetime").setCurrentTime(q(this).val())}_.trigger("changedatetime.xdsoft"),_.trigger("close.xdsoft")}),G.dayOfWeekStartPrev=0===G.dayOfWeekStart?6:G.dayOfWeekStart-1,_.trigger("xchange.xdsoft").trigger("afterOpen.xdsoft")},_.data("options",G).on("touchstart mousedown.xdsoft",function(e){return e.stopPropagation(),e.preventDefault(),Y.hide(),A.hide(),!1}),u.append(P),u.xdsoftScroller(G),_.on("afterOpen.xdsoft",function(){u.xdsoftScroller(G)}),_.append(g).append(n),!0!==G.withoutCopyright&&_.append(e),g.append(F).append(C).append(i),q(G.parentID).append(_),W=new function(){var r=this;r.now=function(e){var t,a,o=new Date;return!e&&G.defaultDate&&(t=r.strToDateTime(G.defaultDate),o.setFullYear(t.getFullYear()),o.setMonth(t.getMonth()),o.setDate(t.getDate())),o.setFullYear(o.getFullYear()),!e&&G.defaultTime&&(a=r.strtotime(G.defaultTime),o.setHours(a.getHours()),o.setMinutes(a.getMinutes()),o.setSeconds(a.getSeconds()),o.setMilliseconds(a.getMilliseconds())),o},r.isValidDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.getTime())},r.setCurrentTime=function(e,t){"string"==typeof e?r.currentTime=r.strToDateTime(e):r.isValidDate(e)?r.currentTime=e:e||t||!G.allowBlank||G.inline?r.currentTime=r.now():r.currentTime=null,_.trigger("xchange.xdsoft")},r.empty=function(){r.currentTime=null},r.getCurrentTime=function(){return r.currentTime},r.nextMonth=function(){void 0!==r.currentTime&&null!==r.currentTime||(r.currentTime=r.now());var e,t=r.currentTime.getMonth()+1;return 12===t&&(r.currentTime.setFullYear(r.currentTime.getFullYear()+1),t=0),e=r.currentTime.getFullYear(),r.currentTime.setDate(Math.min(new Date(r.currentTime.getFullYear(),t+1,0).getDate(),r.currentTime.getDate())),r.currentTime.setMonth(t),G.onChangeMonth&&q.isFunction(G.onChangeMonth)&&G.onChangeMonth.call(_,W.currentTime,_.data("input")),e!==r.currentTime.getFullYear()&&q.isFunction(G.onChangeYear)&&G.onChangeYear.call(_,W.currentTime,_.data("input")),_.trigger("xchange.xdsoft"),t},r.prevMonth=function(){void 0!==r.currentTime&&null!==r.currentTime||(r.currentTime=r.now());var e=r.currentTime.getMonth()-1;return-1===e&&(r.currentTime.setFullYear(r.currentTime.getFullYear()-1),e=11),r.currentTime.setDate(Math.min(new Date(r.currentTime.getFullYear(),e+1,0).getDate(),r.currentTime.getDate())),r.currentTime.setMonth(e),G.onChangeMonth&&q.isFunction(G.onChangeMonth)&&G.onChangeMonth.call(_,W.currentTime,_.data("input")),_.trigger("xchange.xdsoft"),e},r.getWeekOfYear=function(e){if(G.onGetWeekOfYear&&q.isFunction(G.onGetWeekOfYear)){var t=G.onGetWeekOfYear.call(_,e);if(void 0!==t)return t}var a=new Date(e.getFullYear(),0,1);return 4!==a.getDay()&&a.setMonth(0,1+(4-a.getDay()+7)%7),Math.ceil(((e-a)/864e5+a.getDay()+1)/7)},r.strToDateTime=function(e){var t,a,o=[];return e&&e instanceof Date&&r.isValidDate(e)?e:((o=/^([+-]{1})(.*)$/.exec(e))&&(o[2]=K.parseDate(o[2],G.formatDate)),o&&o[2]?(t=o[2].getTime()-6e4*o[2].getTimezoneOffset(),a=new Date(r.now(!0).getTime()+parseInt(o[1]+"1",10)*t)):a=e?K.parseDate(e,G.format):r.now(),r.isValidDate(a)||(a=r.now()),a)},r.strToDate=function(e){if(e&&e instanceof Date&&r.isValidDate(e))return e;var t=e?K.parseDate(e,G.formatDate):r.now(!0);return r.isValidDate(t)||(t=r.now(!0)),t},r.strtotime=function(e){if(e&&e instanceof Date&&r.isValidDate(e))return e;var t=e?K.parseDate(e,G.formatTime):r.now(!0);return r.isValidDate(t)||(t=r.now(!0)),t},r.str=function(){var e=G.format;return G.yearOffset&&(e=(e=e.replace("Y",r.currentTime.getFullYear()+G.yearOffset)).replace("y",String(r.currentTime.getFullYear()+G.yearOffset).substring(2,4))),K.formatDate(r.currentTime,e)},r.currentTime=this.now()},i.on("touchend click",function(e){e.preventDefault(),_.data("changed",!0),W.setCurrentTime(f()),w.val(W.str()),_.trigger("close.xdsoft")}),F.find(".xdsoft_today_button").on("touchend mousedown.xdsoft",function(){_.data("changed",!0),W.setCurrentTime(0,!0),_.trigger("afterOpen.xdsoft")}).on("dblclick.xdsoft",function(){var e,t,a=W.getCurrentTime();a=new Date(a.getFullYear(),a.getMonth(),a.getDate()),e=W.strToDate(G.minDate),a<(e=new Date(e.getFullYear(),e.getMonth(),e.getDate()))||(t=W.strToDate(G.maxDate),(t=new Date(t.getFullYear(),t.getMonth(),t.getDate()))<a||(w.val(W.str()),w.trigger("change"),_.trigger("close.xdsoft")))}),F.find(".xdsoft_prev,.xdsoft_next").on("touchend mousedown.xdsoft",function(){var a=q(this),o=0,r=!1;!function e(t){a.hasClass(G.next)?W.nextMonth():a.hasClass(G.prev)&&W.prevMonth(),G.monthChangeSpinner&&(r||(o=setTimeout(e,t||100)))}(500),q([G.ownerDocument.body,G.contentWindow]).on("touchend mouseup.xdsoft",function e(){clearTimeout(o),r=!0,q([G.ownerDocument.body,G.contentWindow]).off("touchend mouseup.xdsoft",e)})}),n.find(".xdsoft_prev,.xdsoft_next").on("touchend mousedown.xdsoft",function(){var n=q(this),i=0,s=!1,d=110;!function e(t){var a=u[0].clientHeight,o=P[0].offsetHeight,r=Math.abs(parseInt(P.css("marginTop"),10));n.hasClass(G.next)&&o-a-G.timeHeightInTimePicker>=r?P.css("marginTop","-"+(r+G.timeHeightInTimePicker)+"px"):n.hasClass(G.prev)&&0<=r-G.timeHeightInTimePicker&&P.css("marginTop","-"+(r-G.timeHeightInTimePicker)+"px"),u.trigger("scroll_element.xdsoft_scroller",[Math.abs(parseInt(P[0].style.marginTop,10)/(o-a))]),d=10<d?10:d-10,s||(i=setTimeout(e,t||d))}(500),q([G.ownerDocument.body,G.contentWindow]).on("touchend mouseup.xdsoft",function e(){clearTimeout(i),s=!0,q([G.ownerDocument.body,G.contentWindow]).off("touchend mouseup.xdsoft",e)})}),t=0,_.on("xchange.xdsoft",function(e){clearTimeout(t),t=setTimeout(function(){void 0!==W.currentTime&&null!==W.currentTime||(W.currentTime=W.now());for(var e,t,a,o,r,n,i,s,d,u,l="",f=new Date(W.currentTime.getFullYear(),W.currentTime.getMonth(),1,12,0,0),c=0,m=W.now(),h=!1,g=!1,p=!1,D=!1,y=[],k=!0,v="";f.getDay()!==G.dayOfWeekStart;)f.setDate(f.getDate()-1);for(l+="<table><thead><tr>",G.weeks&&(l+="<th></th>"),e=0;e<7;e+=1)l+="<th>"+G.i18n[U].dayOfWeekShort[(e+G.dayOfWeekStart)%7]+"</th>";for(l+="</tr></thead>",l+="<tbody>",!1!==G.maxDate&&(h=W.strToDate(G.maxDate),h=new Date(h.getFullYear(),h.getMonth(),h.getDate(),23,59,59,999)),!1!==G.minDate&&(g=W.strToDate(G.minDate),g=new Date(g.getFullYear(),g.getMonth(),g.getDate())),!1!==G.minDateTime&&(p=W.strToDate(G.minDateTime),p=new Date(p.getFullYear(),p.getMonth(),p.getDate(),p.getHours(),p.getMinutes(),p.getSeconds())),!1!==G.maxDateTime&&(D=W.strToDate(G.maxDateTime),D=new Date(D.getFullYear(),D.getMonth(),D.getDate(),D.getHours(),D.getMinutes(),D.getSeconds())),!1!==D&&(u=31*(12*D.getFullYear()+D.getMonth())+D.getDate());c<W.currentTime.countDaysInMonth()||f.getDay()!==G.dayOfWeekStart||W.currentTime.getMonth()===f.getMonth();){y=[],c+=1,a=f.getDay(),o=f.getDate(),r=f.getFullYear(),O=f.getMonth(),n=W.getWeekOfYear(f),d="",y.push("xdsoft_date"),i=G.beforeShowDay&&q.isFunction(G.beforeShowDay.call)?G.beforeShowDay.call(_,f):null,G.allowDateRe&&"[object RegExp]"===Object.prototype.toString.call(G.allowDateRe)&&(G.allowDateRe.test(K.formatDate(f,G.formatDate))||y.push("xdsoft_disabled")),G.allowDates&&0<G.allowDates.length&&-1===G.allowDates.indexOf(K.formatDate(f,G.formatDate))&&y.push("xdsoft_disabled");var x=31*(12*f.getFullYear()+f.getMonth())+f.getDate();(!1!==h&&h<f||!1!==p&&f<p||!1!==g&&f<g||!1!==D&&u<x||i&&!1===i[0])&&y.push("xdsoft_disabled"),-1!==G.disabledDates.indexOf(K.formatDate(f,G.formatDate))&&y.push("xdsoft_disabled"),-1!==G.disabledWeekDays.indexOf(a)&&y.push("xdsoft_disabled"),w.is("[disabled]")&&y.push("xdsoft_disabled"),i&&""!==i[1]&&y.push(i[1]),W.currentTime.getMonth()!==O&&y.push("xdsoft_other_month"),(G.defaultSelect||_.data("changed"))&&K.formatDate(W.currentTime,G.formatDate)===K.formatDate(f,G.formatDate)&&y.push("xdsoft_current"),K.formatDate(m,G.formatDate)===K.formatDate(f,G.formatDate)&&y.push("xdsoft_today"),0!==f.getDay()&&6!==f.getDay()&&-1===G.weekends.indexOf(K.formatDate(f,G.formatDate))||y.push("xdsoft_weekend"),void 0!==G.highlightedDates[K.formatDate(f,G.formatDate)]&&(t=G.highlightedDates[K.formatDate(f,G.formatDate)],y.push(void 0===t.style?"xdsoft_highlighted_default":t.style),d=void 0===t.desc?"":t.desc),G.beforeShowDay&&q.isFunction(G.beforeShowDay)&&y.push(G.beforeShowDay(f)),k&&(l+="<tr>",k=!1,G.weeks&&(l+="<th>"+n+"</th>")),l+='<td data-date="'+o+'" data-month="'+O+'" data-year="'+r+'" class="xdsoft_date xdsoft_day_of_week'+f.getDay()+" "+y.join(" ")+'" title="'+d+'"><div>'+o+"</div></td>",f.getDay()===G.dayOfWeekStartPrev&&(l+="</tr>",k=!0),f.setDate(o+1)}l+="</tbody></table>",C.html(l),F.find(".xdsoft_label span").eq(0).text(G.i18n[U].months[W.currentTime.getMonth()]),F.find(".xdsoft_label span").eq(1).text(W.currentTime.getFullYear()+G.yearOffset),O=v="";var b=0;if(!1!==G.minTime){var T=W.strtotime(G.minTime);b=60*T.getHours()+T.getMinutes()}var S=1440;if(!1!==G.maxTime){T=W.strtotime(G.maxTime);S=60*T.getHours()+T.getMinutes()}if(!1!==G.minDateTime){T=W.strToDateTime(G.minDateTime);if(K.formatDate(W.currentTime,G.formatDate)===K.formatDate(T,G.formatDate)){var O=60*T.getHours()+T.getMinutes();b<O&&(b=O)}}if(!1!==G.maxDateTime){T=W.strToDateTime(G.maxDateTime);if(K.formatDate(W.currentTime,G.formatDate)===K.formatDate(T,G.formatDate))(O=60*T.getHours()+T.getMinutes())<S&&(S=O)}if(s=function(e,t){var a,o=W.now(),r=G.allowTimes&&q.isArray(G.allowTimes)&&G.allowTimes.length;o.setHours(e),e=parseInt(o.getHours(),10),o.setMinutes(t),t=parseInt(o.getMinutes(),10),y=[];var n=60*e+t;(w.is("[disabled]")||S<=n||n<b)&&y.push("xdsoft_disabled"),(a=new Date(W.currentTime)).setHours(parseInt(W.currentTime.getHours(),10)),r||a.setMinutes(Math[G.roundTime](W.currentTime.getMinutes()/G.step)*G.step),(G.initTime||G.defaultSelect||_.data("changed"))&&a.getHours()===parseInt(e,10)&&(!r&&59<G.step||a.getMinutes()===parseInt(t,10))&&(G.defaultSelect||_.data("changed")?y.push("xdsoft_current"):G.initTime&&y.push("xdsoft_init_time")),parseInt(m.getHours(),10)===parseInt(e,10)&&parseInt(m.getMinutes(),10)===parseInt(t,10)&&y.push("xdsoft_today"),v+='<div class="xdsoft_time '+y.join(" ")+'" data-hour="'+e+'" data-minute="'+t+'">'+K.formatDate(o,G.formatTime)+"</div>"},G.allowTimes&&q.isArray(G.allowTimes)&&G.allowTimes.length)for(c=0;c<G.allowTimes.length;c+=1)s(W.strtotime(G.allowTimes[c]).getHours(),O=W.strtotime(G.allowTimes[c]).getMinutes());else for(e=c=0;c<(G.hours12?12:24);c+=1)for(e=0;e<60;e+=G.step){var M=60*c+e;M<b||(S<=M||s((c<10?"0":"")+c,O=(e<10?"0":"")+e))}for(P.html(v),j="",c=parseInt(G.yearStart,10);c<=parseInt(G.yearEnd,10);c+=1)j+='<div class="xdsoft_option '+(W.currentTime.getFullYear()===c?"xdsoft_current":"")+'" data-value="'+c+'">'+(c+G.yearOffset)+"</div>";for(Y.children().eq(0).html(j),c=parseInt(G.monthStart,10),j="";c<=parseInt(G.monthEnd,10);c+=1)j+='<div class="xdsoft_option '+(W.currentTime.getMonth()===c?"xdsoft_current":"")+'" data-value="'+c+'">'+G.i18n[U].months[c]+"</div>";A.children().eq(0).html(j),q(_).trigger("generate.xdsoft")},10),e.stopPropagation()}).on("afterOpen.xdsoft",function(){var e,t,a,o;G.timepicker&&(P.find(".xdsoft_current").length?e=".xdsoft_current":P.find(".xdsoft_init_time").length&&(e=".xdsoft_init_time"),e?(t=u[0].clientHeight,(a=P[0].offsetHeight)-t<(o=P.find(e).index()*G.timeHeightInTimePicker+1)&&(o=a-t),u.trigger("scroll_element.xdsoft_scroller",[parseInt(o,10)/(a-t)])):u.trigger("scroll_element.xdsoft_scroller",[0]))}),o=0,C.on("touchend click.xdsoft","td",function(e){e.stopPropagation(),o+=1;var t=q(this),a=W.currentTime;if(null==a&&(W.currentTime=W.now(),a=W.currentTime),t.hasClass("xdsoft_disabled"))return!1;a.setDate(1),a.setFullYear(t.data("year")),a.setMonth(t.data("month")),a.setDate(t.data("date")),_.trigger("select.xdsoft",[a]),w.val(W.str()),G.onSelectDate&&q.isFunction(G.onSelectDate)&&G.onSelectDate.call(_,W.currentTime,_.data("input"),e),_.data("changed",!0),_.trigger("xchange.xdsoft"),_.trigger("changedatetime.xdsoft"),(1<o||!0===G.closeOnDateSelect||!1===G.closeOnDateSelect&&!G.timepicker)&&!G.inline&&_.trigger("close.xdsoft"),setTimeout(function(){o=0},200)}),P.on("touchstart","div",function(e){this.touchMoved=!1}).on("touchmove","div",l).on("touchend click.xdsoft","div",function(e){if(!this.touchMoved){e.stopPropagation();var t=q(this),a=W.currentTime;if(null==a&&(W.currentTime=W.now(),a=W.currentTime),t.hasClass("xdsoft_disabled"))return!1;a.setHours(t.data("hour")),a.setMinutes(t.data("minute")),_.trigger("select.xdsoft",[a]),_.data("input").val(W.str()),G.onSelectTime&&q.isFunction(G.onSelectTime)&&G.onSelectTime.call(_,W.currentTime,_.data("input"),e),_.data("changed",!0),_.trigger("xchange.xdsoft"),_.trigger("changedatetime.xdsoft"),!0!==G.inline&&!0===G.closeOnTimeSelect&&_.trigger("close.xdsoft")}}),g.on("mousewheel.xdsoft",function(e){return!G.scrollMonth||(e.deltaY<0?W.nextMonth():W.prevMonth(),!1)}),w.on("mousewheel.xdsoft",function(e){return!G.scrollInput||(!G.datepicker&&G.timepicker?(0<=(a=P.find(".xdsoft_current").length?P.find(".xdsoft_current").eq(0).index():0)+e.deltaY&&a+e.deltaY<P.children().length&&(a+=e.deltaY),P.children().eq(a).length&&P.children().eq(a).trigger("mousedown"),!1):G.datepicker&&!G.timepicker?(g.trigger(e,[e.deltaY,e.deltaX,e.deltaY]),w.val&&w.val(W.str()),_.trigger("changedatetime.xdsoft"),!1):void 0)}),_.on("changedatetime.xdsoft",function(e){if(G.onChangeDateTime&&q.isFunction(G.onChangeDateTime)){var t=_.data("input");G.onChangeDateTime.call(_,W.currentTime,t,e),delete G.value,t.trigger("change")}}).on("generate.xdsoft",function(){G.onGenerate&&q.isFunction(G.onGenerate)&&G.onGenerate.call(_,W.currentTime,_.data("input")),s&&(_.trigger("afterOpen.xdsoft"),s=!1)}).on("click.xdsoft",function(e){e.stopPropagation()}),a=0,h=function(e,t){do{if(!(e=e.parentNode)||!1===t(e))break}while("HTML"!==e.nodeName)},r=function(){var e,t,a,o,r,n,i,s,d,u,l,f,c;if(e=(s=_.data("input")).offset(),t=s[0],u="top",a=e.top+t.offsetHeight-1,o=e.left,r="absolute",d=q(G.contentWindow).width(),f=q(G.contentWindow).height(),c=q(G.contentWindow).scrollTop(),G.ownerDocument.documentElement.clientWidth-e.left<g.parent().outerWidth(!0)){var m=g.parent().outerWidth(!0)-t.offsetWidth;o-=m}"rtl"===s.parent().css("direction")&&(o-=_.outerWidth()-s.outerWidth()),G.fixed?(a-=c,o-=q(G.contentWindow).scrollLeft(),r="fixed"):(i=!1,h(t,function(e){return null!==e&&("fixed"===G.contentWindow.getComputedStyle(e).getPropertyValue("position")?(i=!0,!1):void 0)}),i?(r="fixed",a+_.outerHeight()>f+c?(u="bottom",a=f+c-e.top):a-=c):a+_[0].offsetHeight>f+c&&(a=e.top-_[0].offsetHeight+1),a<0&&(a=0),o+t.offsetWidth>d&&(o=d-t.offsetWidth)),n=_[0],h(n,function(e){if("relative"===G.contentWindow.getComputedStyle(e).getPropertyValue("position")&&d>=e.offsetWidth)return o-=(d-e.offsetWidth)/2,!1}),(l={position:r,left:o,top:"",bottom:""})[u]=a,_.css(l)},_.on("open.xdsoft",function(e){var t=!0;G.onShow&&q.isFunction(G.onShow)&&(t=G.onShow.call(_,W.currentTime,_.data("input"),e)),!1!==t&&(_.show(),r(),q(G.contentWindow).off("resize.xdsoft",r).on("resize.xdsoft",r),G.closeOnWithoutClick&&q([G.ownerDocument.body,G.contentWindow]).on("touchstart mousedown.xdsoft",function e(){_.trigger("close.xdsoft"),q([G.ownerDocument.body,G.contentWindow]).off("touchstart mousedown.xdsoft",e)}))}).on("close.xdsoft",function(e){var t=!0;F.find(".xdsoft_month,.xdsoft_year").find(".xdsoft_select").hide(),G.onClose&&q.isFunction(G.onClose)&&(t=G.onClose.call(_,W.currentTime,_.data("input"),e)),!1===t||G.opened||G.inline||_.hide(),e.stopPropagation()}).on("toggle.xdsoft",function(){_.is(":visible")?_.trigger("close.xdsoft"):_.trigger("open.xdsoft")}).data("input",w),d=0,_.data("xdsoft_datetime",W),_.setOptions(G),W.setCurrentTime(f()),w.data("xdsoft_datetimepicker",_).on("open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart",function(){w.is(":disabled")||w.data("xdsoft_datetimepicker").is(":visible")&&G.closeOnInputClick||G.openOnFocus&&(clearTimeout(d),d=setTimeout(function(){w.is(":disabled")||(s=!0,W.setCurrentTime(f(),!0),G.mask&&c(G),_.trigger("open.xdsoft"))},100))}).on("keydown.xdsoft",function(e){var t,a=e.which;return-1!==[b].indexOf(a)&&G.enterLikeTab?(t=q("input:visible,textarea:visible,button:visible,a:visible"),_.trigger("close.xdsoft"),t.eq(t.index(this)+1).focus(),!1):-1!==[z].indexOf(a)?(_.trigger("close.xdsoft"),!0):void 0}).on("blur.xdsoft",function(){_.trigger("close.xdsoft")})},r=function(e){var t=e.data("xdsoft_datetimepicker");t&&(t.data("xdsoft_datetime",null),t.remove(),e.data("xdsoft_datetimepicker",null).off(".xdsoft"),q(G.contentWindow).off("resize.xdsoft"),q([G.contentWindow,G.ownerDocument.body]).off("mousedown.xdsoft touchstart"),e.unmousewheel&&e.unmousewheel())},q(G.ownerDocument).off("keydown.xdsoftctrl keyup.xdsoftctrl").on("keydown.xdsoftctrl",function(e){e.keyCode===v&&(B=!0)}).on("keyup.xdsoftctrl",function(e){e.keyCode===v&&(B=!1)}),this.each(function(){var t,e=q(this).data("xdsoft_datetimepicker");if(e){if("string"===q.type(j))switch(j){case"show":q(this).select().focus(),e.trigger("open.xdsoft");break;case"hide":e.trigger("close.xdsoft");break;case"toggle":e.trigger("toggle.xdsoft");break;case"destroy":r(q(this));break;case"reset":this.value=this.defaultValue,this.value&&e.data("xdsoft_datetime").isValidDate(K.parseDate(this.value,G.format))||e.data("changed",!1),e.data("xdsoft_datetime").setCurrentTime(this.value);break;case"validate":e.data("input").trigger("blur.xdsoft");break;default:e[j]&&q.isFunction(e[j])&&(n=e[j](a))}else e.setOptions(j);return 0}"string"!==q.type(j)&&(!G.lazyInit||G.open||G.inline?o(q(this)):(t=q(this)).on("open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart",function e(){t.is(":disabled")||t.data("xdsoft_datetimepicker")||(clearTimeout(i),i=setTimeout(function(){t.data("xdsoft_datetimepicker")||o(t),t.off("open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart",e).trigger("open.xdsoft")},100))}))}),n},q.fn.datetimepicker.defaults=s};!function(e){"function"==typeof define&&define.amd?define(["jquery","jquery-mousewheel"],e):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(datetimepickerFactory); |