PageSourceSearch

https://static.surfearner.com/js/jquery.datetimepicker.js

js surfearner.com collected 2026-09-26 00:48:10 UTC 78,385 bytes, 2,026 lines download raw bytes

1/**
2 * @preserve jQuery DateTimePicker plugin v2.4.3
3 * @homepage http://xdsoft.net/jqplugins/datetimepicker/
4 * (c) 2014, Chupurnov Valeriy.
5 */
6/*global document,window,jQuery,setTimeout,clearTimeout,HighlightedDate,getCurrentValue*/
7(function ($) {
8	'use strict';
9	var default_options  = {
10		i18n: {
11			ar: { // Arabic
12				months: [
13					"كانون الثاني", "شباط", "آذار", "نيسان", "مايو", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول"
14				],
15				dayOfWeek: [
16					"ن", "ث", "ع", "خ", "ج", "س", "ح"
17				]
18			},
19			ro: { // Romanian
20				months: [
21					"ianuarie", "februarie", "martie", "aprilie", "mai", "iunie", "iulie", "august", "septembrie", "octombrie", "noiembrie", "decembrie"
22				],
23				dayOfWeek: [
24					"l", "ma", "mi", "j", "v", "s", "d"
25				]
26			},
27			id: { // Indonesian
28				months: [
29					"Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "De
29sember"
30				],
31				dayOfWeek: [
32					"Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"
33				]
34			},
35			bg: { // Bulgarian
36				months: [
37					"Януари", "Февруари", "Март", "Април", "Май", "Юни", "Юли", "Август", "Септември", "Октомври", "Ноември", "Декември"
38				],
39				dayOfWeek: [
40					"Нд", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"
41				]
42			},
43			fa: { // Persian/Farsi
44				months: [
45					'فروردین', 'اردیبهشت', 'خرداد', 'تیر', 'مرداد', 'شهریور', 'مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسفند'
46				],
47				dayOfWeek: [
48					'یکشنبه', 'دوشنبه', 'سه شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'
49				]
50			},
51			ru: { // Russian
52				months: [
53					'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'
54				],
55				dayOfWeek: [
56					"Вск", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"
57				]
58			},
59			uk: { // Ukrainian
60				months: [
61					'Січень', 'Лютий', 'Березень', 'Квітень', 'Травень', 'Червень', 'Липень', 'Серпень', 'Вересень', 'Жовтень', 'Листопад', 'Грудень'
62				],
63				dayOfWeek: [
64					"Ндл", "Пнд", "Втр", "Срд", "Чтв", "Птн", "Сбт"
65				]
66			},
67			en: { // English
68				months: [
69					"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "
69November", "December"
70				],
71				dayOfWeek: [
72					"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
73				]
74			},
75			el: { // Ελληνικά
76				months: [
77					"Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάιος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"
78				],
79				dayOfWeek: [
80					"Κυρ", "Δευ", "Τρι", "Τετ", "Πεμ", "Παρ", "Σαβ"
81				]
82			},
83			de: { // German
84				months: [
85					'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'
86				],
87				dayOfWeek: [
88					"So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"
89				]
90			},
91			nl: { // Dutch
92				months: [
93					"januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december"
94				],
95				dayOfWeek: [
96					"zo", "ma", "di", "wo", "do", "vr", "za"
97				]
98			},
99			tr: { // Turkish
100				months: [
101					"Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"
102				],
103				dayOfWeek: [
104					"Paz", "Pts", "Sal", "Çar", "Per", "Cum", "Cts"
105				]
106			},
107			fr: { //French
108				months: [
109					"Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"
110				],
111				dayOfWeek: [
112					"Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"
113				]
114			},
115			es: { // Spanish
116				months: [
117					"Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"
118				],
119				dayOfWeek: [
120					"Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb"
121				]
122			},
123			th: { // Thai
124				months: [
125					'มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม'
126				],
127				dayOfWeek: [
128					'อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'
129				]
130			},
131			pl: { // Polish
132				months: [
133					"styczeń", "luty", "marzec", "kwiecień", "maj", "czerwiec", "lipiec", "sierpień", "wrzesień", "październik", "listopad", "grudzień"
134				],
135				dayOfWeek: [
136					"nd", "pn", "wt", "śr", "cz", "pt", "sb"
137				]
138			},
139			pt: { // Portuguese
140				months: [
141					"Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"
142				],
143				dayOfWeek: [
144					"Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"
145				]
146			},
147			ch: { // Simplified Chinese
148				months: [
149					"一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"
150				],
151				dayOfWeek: [
152					"日", "一", "二", "三", "四", "五", "六"
153				]
154			},
155			se: { // Swedish
156				months: [
157					"Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September",  "Oktober", "November", "December"
158				],
159				dayOfWeek: [
160					"Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör"
161				]
162			},
163			kr: { // Korean
164				months: [
165					"1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"
166				],
167				dayOfWeek: [
168					"일", "월", "화", "수", "목", "금", "토"
169				]
170			},
171			it: { // Italian
172				months: [
173					"Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"
174				],
175				dayOfWeek: [
176					"Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"
177				]
178			},
179			da: { // Dansk
180				months: [
181					"January", "Februar", "Marts", "April", "Maj", "Juni", "July", "August", "September", "Oktober", "November", "December"
182				],
183				dayOfWeek: [
184					"Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"
185				]
186			},
187			no: { // Norwegian
188				months: [
189					"Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"
190				],
191				dayOfWeek: [
192					"Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"
193				]
194			},
195			ja: { // Japanese
196				months: [
197					"1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"
198				],
199				dayOfWeek: [
200					"日", "月", "火", "水", "木", "金", "土"
201				]
202			},
203			vi: { // Vietnamese
204				months: [
205					"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"
206				],
207				dayOfWeek: [
208					"CN", "T2", "T3", "T4", "T5", "T6", "T7"
209				]
210			},
211			sl: { // Slovenščina
212				months: [
213					"Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "
213November", "December"
214				],
215				dayOfWeek: [
216					"Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob"
217				]
218			},
219			cs: { // Čeština
220				months: [
221					"Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"
222				],
223				dayOfWeek: [
224					"Ne", "Po", "Út", "St", "Čt", "Pá", "So"
225				]
226			},
227			hu: { // Hungarian
228				months: [
229					"Január", "Február", "Március", "Április", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December"
230				],
231				dayOfWeek: [
232					"Va", "Hé", "Ke", "Sze", "Cs", "Pé", "Szo"
233				]
234			},
235			az: { //Azerbaijanian (Azeri)
236				months: [
237					"Yanvar", "Fevral", "Mart", "Aprel", "May", "Iyun", "Iyul", "Avqust", "Sentyabr", "Oktyabr", "Noyabr", "Dekabr"
238				],
239				dayOfWeek: [
240					"B", "Be", "Ça", "Ç", "Ca", "C", "Ş"
241				]
242			},
243			bs: { //Bosanski
244				months: [
245					"Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar"
246				],
247				dayOfWeek: [
248					"Ned", "Pon", "Uto", "Sri", "Čet", "Pet", "Sub"
249				]
250			},
251			ca: { //Català
252				months: [
253					"Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"
254				],
255				dayOfWeek: [
256					"Dg", "Dl", "Dt", "Dc", "Dj", "Dv", "Ds"
257				]
258			},
259			'en-GB': { //English (British)
260				months: [
261					"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "
261November", "December"
262				],
263				dayOfWeek: [
264					"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
265				]
266			},
267			et: { //"Eesti"
268				months: [
269					"Jaanuar", "Veebruar", "Märts", "Aprill", "Mai", "Juuni", "Juuli", "August", "September", "Oktoober", "November", "Detsember"
270				],
271				dayOfWeek: [
272					"P", "E", "T", "K", "N", "R", "L"
273				]
274			},
275			eu: { //Euskara
276				months: [
277					"Urtarrila", "Otsaila", "Martxoa", "Apirila", "Maiatza", "Ekaina", "Uztaila", "Abuztua", "Iraila", "Urria", "Azaroa", "Abendua"
278				],
279				dayOfWeek: [
280					"Ig.", "Al.", "Ar.", "Az.", "Og.", "Or.", "La."
281				]
282			},
283			fi: { //Finnish (Suomi)
284				months: [
285					"Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"
286				],
287				dayOfWeek: [
288					"Su", "Ma", "Ti", "Ke", "To", "Pe", "La"
289				]
290			},
291			gl: { //Galego
292				months: [
293					"Xan", "Feb", "Maz", "Abr", "Mai", "Xun", "Xul", "Ago", "Set", "Out", "Nov", "Dec"
294				],
295				dayOfWeek: [
296					"Dom", "Lun", "Mar", "Mer", "Xov", "Ven", "Sab"
297				]
298			},
299			hr: { //Hrvatski
300				months: [
301					"Siječanj", "Veljača", "Ožujak", "Travanj", "Svibanj", "Lipanj", "Srpanj", "Kolovoz", "Rujan", "Listopad", "Studeni", "Prosinac"
302				],
303				dayOfWeek: [
304					"Ned", "Pon", "Uto", "Sri", "Čet", "Pet", "Sub"
305				]
306			},
307			ko: { //Korean (한국어)
308				months: [
309					"1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"
310				],
311				dayOfWeek: [
312					"일", "월", "화", "수", "목", "금", "토"
313				]
314			},
315			lt: { //Lithuanian (lietuvių)
316				months: [
317					"Sausio", "Vasario", "Kovo", "Balandžio", "Gegužės", "Birželio", "Liepos", "Rugpjūčio", "Rugsėjo", "Spalio", "Lapkričio", "Gruodžio"
318				],
319				dayOfWeek: [
320					"Sek", "Pir", "Ant", "Tre", "Ket", "Pen", "Šeš"
321				]
322			},
323			lv: { //Latvian (Latviešu)
324				months: [
325					"Janvāris", "Februāris", "Marts", "Aprīlis ", "Maijs", "Jūnijs", "Jūlijs", "Augusts", "Septembris", "Oktobris", "Novembris", "Decembris"
326				],
327				dayOfWeek: [
328					"Sv", "Pr", "Ot", "Tr", "Ct", "Pk", "St"
329				]
330			},
331			mk: { //Macedonian (Македонски)
332				months: [
333					"јануари", "февруари", "март", "април", "мај", "јуни", "јули", "август", "септември", "октомври", "ноември", "декември"
334				],
335				dayOfWeek: [
336					"нед", "пон", "вто", "сре", "чет", "пет", "саб"
337				]
338			},
339			mn: { //Mongolian (Монгол)
340				months: [
341					"1-р сар", "2-р сар", "3-р сар", "4-р сар", "5-р сар", "6-р сар", "7-р сар", "8-р сар", "9-р сар", "10-р сар", "11-р сар", "12-р сар"
342				],
343				dayOfWeek: [
344					"Дав", "Мяг", "Лха", "Пүр", "Бсн", "Бям", "Ням"
345				]
346			},
347			'pt-BR': { //Português(Brasil)
348				months: [
349					"Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"
350				],
351				dayOfWeek: [
352					"Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb"
353				]
354			},
355			sk: { //Slovenčina
356				months: [
357					"Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"
358				],
359				dayOfWeek: [
360					"Ne", "Po", "Ut", "St", "Å t", "Pi", "So"
361				]
362			},
363			sq: { //Albanian (Shqip)
364				months: [
365					"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "
365November", "December"
366				],
367				dayOfWeek: [
368					"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
369				]
370			},
371			'sr-YU': { //Serbian (Srpski)
372				months: [
373					"Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar"
374				],
375				dayOfWeek: [
376					"Ned", "Pon", "Uto", "Sre", "čet", "Pet", "Sub"
377				]
378			},
379			sr: { //Serbian Cyrillic (Српски)
380				months: [
381					"јануар", "фебруар", "март", "април", "мај", "јун", "јул", "август", "септембар", "октобар", "новембар", "децембар"
382				],
383				dayOfWeek: [
384					"нед", "пон", "уто", "сре", "чет", "пет", "суб"
385				]
386			},
387			sv: { //Svenska
388				months: [
389					"Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"
390				],
391				dayOfWeek: [
392					"Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör"
393				]
394			},
395			'zh-TW': { //Traditional Chinese (繁體中文)
396				months: [
397					"一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"
398				],
399				dayOfWeek: [
400					"日", "一", "二", "三", "四", "五", "六"
401				]
402			},
403			zh: { //Simplified Chinese (简体中文)
404				months: [
405					"一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"
406				],
407				dayOfWeek: [
408					"日", "一", "二", "三", "四", "五", "六"
409				]
410			},
411			he: { //Hebrew (עברית)
412				months: [
413					'ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר'
414				],
415				dayOfWeek: [
416					'א\'', 'ב\'', 'ג\'', 'ד\'', 'ה\'', 'ו\'', 'שבת'
417				]
418			},
419			hy: { // Armenian
420				months: [
421					"Հունվար", "Փետրվար", "Մարտ", "Ապրիլ", "Մայիս", "Հունիս", "Հուլիս", "Օգոստոս", "Սեպտեմբեր", "Հոկտեմբեր", "Նոյեմբեր", "Դեկտեմբեր"
422				],
423				dayOfWeek: [
424					"Կի", "Երկ", "Երք", "Չոր", "Հնգ", "Ուրբ", "Շբթ"
425				]
426			},
427            kg: { // Kyrgyz
428                months: [
429                    'Үчтүн айы', 'Бирдин айы', 'Жалган Куран', 'Чын Куран', 'Бугу', 'Кулжа', 'Теке', 'Баш Оона', 'Аяк Оона', 'Тогуздун айы', 'Жетинин айы', 'Бештин айы'
430                ],
431                dayOfWeek: [
432                    "Жек", "Дүй", "Шей", "Шар", "Бей", "Жум", "Ише"
433                ]
434            }
435		},
436		value: '',
437		lang: 'en',
438
439		format:	'Y/m/d H:i',
440		formatTime:	'H:i',
441		formatDate:	'Y/m/d',
442
443		startDate:	false, // new Date(), '1986/12/08', '-1970/01/05','-1970/01/05',
444		step: 60,
445		monthChangeSpinner: true,
446
447		closeOnDateSelect: false,
448		closeOnTimeSelect: true,
449		closeOnWithoutClick: true,
450		closeOnInputClick: true,
451
452		timepicker: true,
453		datepicker: true,
454		weeks: false,
455
456		defaultTime: false,	// use formatTime format (ex. '10:00' for formatTime:	'H:i')
457		defaultDate: false,	// use formatDate format (ex new Date() or '1986/12/08' or '-1970/01/05' or '-1970/01/05')
458
459		minDate: false,
460		maxDate: false,
461		minTime: false,
462		maxTime: false,
463
464		allowTimes: [],
465		opened: false,
466		initTime: true,
467		inline: false,
468		theme: '',
469
470		onSelectDate: function () {},
471		onSelectTime: function () {},
472		onChangeMonth: function () {},
473		onChangeYear: function () {},
474		onChangeDateTime: function () {},
475		onShow: function () {},
476		onClose: function () {},
477		onGenerate: function () {},
478
479		withoutCopyright: true,
480		inverseButton: false,
481		hours12: false,
482		next: 'xdsoft_next',
483		prev : 'xdsoft_prev',
484		dayOfWeekStart: 0,
485		parentID: 'body',
486		timeHeightInTimePicker: 25,
487		timepickerScrollbar: true,
488		todayButton: true,
489		prevButton: true,
490		nextButton: true,
491		defaultSelect: true,
492
493		scrollMonth: true,
494		scrollTime: true,
495		scrollInput: true,
496
497		lazyInit: false,
498		mask: false,
499		validateOnBlur: true,
500		allowBlank: true,
501		yearStart: 1950,
502		yearEnd: 2050,
503		monthStart: 0,
504		monthEnd: 11,
505		style: '',
506		id: '',
507		fixed: false,
508		roundTime: 'round', // ceil, floor
509		className: '',
510		weekends: [],
511		highlightedDates: [],
512		highlightedPeriods: [],
513		disabledDates : [],
514		yearOffset: 0,
515		beforeShowDay: null,
516
517		enterLikeTab: true,
vendor: 5,086 bytes, lines 518-665
518        showApplyButton: false
519	};
520	// fix for ie8
521	if (!Array.prototype.indexOf) {
522		Array.prototype.indexOf = function (obj, start) {
523			var i, j;
524			for (i = (start || 0), j = this.length; i < j; i += 1) {
525				if (this[i] === obj) { return i; }
526			}
527			return -1;
528		};
529	}
530	Date.prototype.countDaysInMonth = function () {
531		return new Date(this.getFullYear(), this.getMonth() + 1, 0).getDate();
532	};
533	$.fn.xdsoftScroller = function (percent) {
534		return this.each(function () {
535			var timeboxparent = $(this),
536				pointerEventToXY = function (e) {
537					var out = {x: 0, y: 0},
538						touch;
539					if (e.type === 'touchstart' || e.type === 'touchmove' || e.type === 'touchend' || e.type === 'touchcancel') {
540						touch  = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
541						out.x = touch.clientX;
542						out.y = touch.clientY;
543					} else if (e.type === 'mousedown' || e.type === 'mouseup' || e.type === 'mousemove' || e.type === 'mouseover' || e.type === 'mouseout' || e.type === 'mouseenter' || e.type === 'mouseleave') {
544						out.x = e.clientX;
545						out.y = e.clientY;
546					}
547					return out;
548				},
549				move = 0,
550				timebox,
551				parentHeight,
552				height,
553				scrollbar,
554				scroller,
555				maximumOffset = 100,
556				start = false,
557				startY = 0,
558				startTop = 0,
559				h1 = 0,
560				touchStart = false,
561				startTopScroll = 0,
562				calcOffset = function () {};
563			if (percent === 'hide') {
564				timeboxparent.find('.xdsoft_scrollbar').hide();
565				return;
566			}
567			if (!$(this).hasClass('xdsoft_scroller_box')) {
568				timebox = timeboxparent.children().eq(0);
569				parentHeight = timeboxparent[0].clientHeight;
570				height = timebox[0].offsetHeight;
571				scrollbar = $('<div class="xdsoft_scrollbar"></div>');
572				scroller = $('<div class="xdsoft_scroller"></div>');
573				scrollbar.append(scroller);
574
575				timeboxparent.addClass('xdsoft_scroller_box').append(scrollbar);
576				calcOffset = function calcOffset(event) {
577					var offset = pointerEventToXY(event).y - startY + startTopScroll;
578					if (offset < 0) {
579						offset = 0;
580					}
581					if (offset + scroller[0].offsetHeight > h1) {
582						offset = h1 - scroller[0].offsetHeight;
583					}
584					timeboxparent.trigger('scroll_element.xdsoft_scroller', [maximumOffset ? offset / maximumOffset : 0]);
585				};
586
587				scroller
588					.on('touchstart.xdsoft_scroller mousedown.xdsoft_scroller', function (event) {
589						if (!parentHeight) {
590							timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percent]);
591						}
592
593						startY = pointerEventToXY(event).y;
594						startTopScroll = parseInt(scroller.css('margin-top'), 10);
595						h1 = scrollbar[0].offsetHeight;
596
597						if (event.type === 'mousedown') {
598							if (document) {
599								$(document.body).addClass('xdsoft_noselect');
600							}
601							$([document.body, window]).on('mouseup.xdsoft_scroller', function arguments_callee() {
602								$([document.body, window]).off('mouseup.xdsoft_scroller', arguments_callee)
603									.off('mousemove.xdsoft_scroller', calcOffset)
604									.removeClass('xdsoft_noselect');
605							});
606							$(document.body).on('mousemove.xdsoft_scroller', calcOffset);
607						} else {
608							touchStart = true;
609							event.stopPropagation();
610							event.preventDefault();
611						}
612					})
613					.on('touchmove', function (event) {
614						if (touchStart) {
615							event.preventDefault();
616							calcOffset(event);
617						}
618					})
619					.on('touchend touchcancel', function (event) {
620						touchStart =  false;
621						startTopScroll = 0;
622					});
623
624				timeboxparent
625					.on('scroll_element.xdsoft_scroller', function (event, percentage) {
626						if (!parentHeight) {
627							timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percentage, true]);
628						}
629						percentage = percentage > 1 ? 1 : (percentage < 0 || isNaN(percentage)) ? 0 : percentage;
630
631						scroller.css('margin-top', maximumOffset * percentage);
632
633						setTimeout(function () {
634							timebox.css('marginTop', -parseInt((timebox[0].offsetHeight - parentHeight) * percentage, 10));
635						}, 10);
636					})
637					.on('resize_scroll.xdsoft_scroller', function (event, percentage, noTriggerScroll) {
638						var percent, sh;
639						parentHeight = timeboxparent[0].clientHeight;
640						height = timebox[0].offsetHeight;
641						percent = parentHeight / height;
642						sh = percent * scrollbar[0].offsetHeight;
643						if (percent > 1) {
644							scroller.hide();
645						} else {
646							scroller.show();
647							scroller.css('height', parseInt(sh > 10 ? sh : 10, 10));
648							maximumOffset = scrollbar[0].offsetHeight - scroller[0].offsetHeight;
649							if (noTriggerScroll !== true) {
650								timeboxparent.trigger('scroll_element.xdsoft_scroller', [percentage || Math.abs(parseInt(timebox.css('marginTop'), 10)) / (height - parentHeight)]);
651							}
652						}
653					});
654
655				timeboxparent.on('mousewheel', function (event) {
656					var top = Math.abs(parseInt(timebox.css('marginTop'), 10));
657
658					top = top - (event.deltaY * 20);
659					if (top < 0) {
660						top = 0;
661					}
662
663					timeboxparent.trigger('scroll_element.xdsoft_scroller', [top / (height - parentHeight)]);
664					event.stopPropagation();
665					return false;
vendor: 37,349 bytes, lines 666-1746
666				});
667
668				timeboxparent.on('touchstart', function (event) {
669					start = pointerEventToXY(event);
670					startTop = Math.abs(parseInt(timebox.css('marginTop'), 10));
671				});
672
673				timeboxparent.on('touchmove', function (event) {
674					if (start) {
675						event.preventDefault();
676						var coord = pointerEventToXY(event);
677						timeboxparent.trigger('scroll_element.xdsoft_scroller', [(startTop - (coord.y - start.y)) / (height - parentHeight)]);
678					}
679				});
680
681				timeboxparent.on('touchend touchcancel', function (event) {
682					start = false;
683					startTop = 0;
684				});
685			}
686			timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percent]);
687		});
688	};
689
690	$.fn.datetimepicker = function (opt) {
691		var KEY0 = 48,
692			KEY9 = 57,
693			_KEY0 = 96,
694			_KEY9 = 105,
695			CTRLKEY = 17,
696			DEL = 46,
697			ENTER = 13,
698			ESC = 27,
699			BACKSPACE = 8,
700			ARROWLEFT = 37,
701			ARROWUP = 38,
702			ARROWRIGHT = 39,
703			ARROWDOWN = 40,
704			TAB = 9,
705			F5 = 116,
706			AKEY = 65,
707			CKEY = 67,
708			VKEY = 86,
709			ZKEY = 90,
710			YKEY = 89,
711			ctrlDown	=	false,
712			options = ($.isPlainObject(opt) || !opt) ? $.extend(true, {}, default_options, opt) : $.extend(true, {}, default_options),
713
714			lazyInitTimer = 0,
715			createDateTimePicker,
716			destroyDateTimePicker,
717
718			lazyInit = function (input) {
719				input
720					.on('open.xdsoft focusin.xdsoft mousedown.xdsoft', function initOnActionCallback(event) {
721						if (input.is(':disabled') || input.data('xdsoft_datetimepicker')) {
722							return;
723						}
724						clearTimeout(lazyInitTimer);
725						lazyInitTimer = setTimeout(function () {
726
727							if (!input.data('xdsoft_datetimepicker')) {
728								createDateTimePicker(input);
729							}
730							input
731								.off('open.xdsoft focusin.xdsoft mousedown.xdsoft', initOnActionCallback)
732								.trigger('open.xdsoft');
733						}, 100);
734					});
735			};
736
737		createDateTimePicker = function (input) {
738			var datetimepicker = $('<div class="xdsoft_datetimepicker xdsoft_noselect"></div>'),
739				xdsoft_copyright = $('<div class="xdsoft_copyright"><a target="_blank" href="http://xdsoft.net/jqplugins/datetimepicker/">xdsoft.net</a></div>'),
740				datepicker = $('<div class="xdsoft_datepicker active"></div>'),
741				mounth_picker = $('<div class="xdsoft_mounthpicker"><button type="button" class="xdsoft_prev"></button><button type="button" class="xdsoft_today_button"></button>' +
742					'<div class="xdsoft_label xdsoft_month"><span></span><i></i></div>' +
743					'<div class="xdsoft_label xdsoft_year"><span></span><i></i></div>' +
744					'<button type="button" class="xdsoft_next"></button></div>'),
745				calendar = $('<div class="xdsoft_calendar"></div>'),
746				timepicker = $('<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>'),
747				timeboxparent = timepicker.find('.xdsoft_time_box').eq(0),
748				timebox = $('<div class="xdsoft_time_variant"></div>'),
749                applyButton = $('<button class="xdsoft_save_selected blue-gradient-button">Save Selected</button>'),
750				/*scrollbar = $('<div class="xdsoft_scrollbar"></div>'),
751				scroller = $('<div class="xdsoft_scroller"></div>'),*/
752				monthselect = $('<div class="xdsoft_select xdsoft_monthselect"><div></div></div>'),
753				yearselect = $('<div class="xdsoft_select xdsoft_yearselect"><div></div></div>'),
754				triggerAfterOpen = false,
755				XDSoft_datetime,
756				//scroll_element,
757				xchangeTimer,
758				timerclick,
759				current_time_index,
760				setPos,
761				timer = 0,
762				timer1 = 0,
763				_xdsoft_datetime;
764
765			if (options.id) datetimepicker.attr('id', options.id);
766			if (options.style) datetimepicker.attr('style', options.style);
767			if (options.weeks) datetimepicker.addClass('xdsoft_showweeks');
768
769			datetimepicker.addClass('xdsoft_' + options.theme);
770			datetimepicker.addClass(options.className);
771
772			mounth_picker
773				.find('.xdsoft_month span')
774					.after(monthselect);
775			mounth_picker
776				.find('.xdsoft_year span')
777					.after(yearselect);
778
779			mounth_picker
780				.find('.xdsoft_month,.xdsoft_year')
781					.on('mousedown.xdsoft', function (event) {
782					var select = $(this).find('.xdsoft_select').eq(0),
783						val = 0,
784						top = 0,
785						visible = select.is(':visible'),
786						items,
787						i;
788
789					mounth_picker
790						.find('.xdsoft_select')
791							.hide();
792					if (_xdsoft_datetime.currentTime) {
793						val = _xdsoft_datetime.currentTime[$(this).hasClass('xdsoft_month') ? 'getMonth' : 'getFullYear']();
794					}
795
796					select[visible ? 'hide' : 'show']();
797					for (items = select.find('div.xdsoft_option'), i = 0; i < items.length; i += 1) {
798						if (items.eq(i).data('value') === val) {
799							break;
800						} else {
801							top += items[0].offsetHeight;
802						}
803					}
804
805					select.xdsoftScroller(top / (select.children()[0].offsetHeight - (select[0].clientHeight)));
806					event.stopPropagation();
807					return false;
808				});
809
810			mounth_picker
811				.find('.xdsoft_select')
812					.xdsoftScroller()
813				.on('mousedown.xdsoft', function (event) {
814					event.stopPropagation();
815					event.preventDefault();
816				})
817				.on('mousedown.xdsoft', '.xdsoft_option', function (event) {
818
819					if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null) {
820						_xdsoft_datetime.currentTime = _xdsoft_datetime.now();
821					}
822
823					var year = _xdsoft_datetime.currentTime.getFullYear();
824					if (_xdsoft_datetime && _xdsoft_datetime.currentTime) {
825						_xdsoft_datetime.currentTime[$(this).parent().parent().hasClass('xdsoft_monthselect') ? 'setMonth' : 'setFullYear']($(this).data('value'));
826					}
827
828					$(this).parent().parent().hide();
829
830					datetimepicker.trigger('xchange.xdsoft');
831					if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) {
832						options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
833					}
834
835					if (year !== _xdsoft_datetime.currentTime.getFullYear() && $.isFunction(options.onChangeYear)) {
836						options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
837					}
838				});
839
840			datetimepicker.setOptions = function (_options) {
841				var highlightedDates = {},
842					getCaretPos = function (input) {
843						try {
844							if (document.selection && document.selection.createRange) {
845								var range = document.selection.createRange();
846								return range.getBookmark().charCodeAt(2) - 2;
847							}
848							if (input.setSelectionRange) {
849								return input.selectionStart;
850							}
851						} catch (e) {
852							return 0;
853						}
854					},
855					setCaretPos = function (node, pos) {
856						node = (typeof node === "string" || node instanceof String) ? document.getElementById(node) : node;
857						if (!node) {
858							return false;
859						}
860						if (node.createTextRange) {
861							var textRange = node.createTextRange();
862							textRange.collapse(true);
863							textRange.moveEnd('character', pos);
864							textRange.moveStart('character', pos);
865							textRange.select();
866							return true;
867						}
868						if (node.setSelectionRange) {
869							node.setSelectionRange(pos, pos);
870							return true;
871						}
872						return false;
873					},
874					isValidValue = function (mask, value) {
875						var reg = mask
876							.replace(/([\[\]\/\{\}\(\)\-\.\+]{1})/g, '\\$1')
877							.replace(/_/g, '{digit+}')
878							.replace(/([0-9]{1})/g, '{digit$1}')
879							.replace(/\{digit([0-9]{1})\}/g, '[0-$1_]{1}')
880							.replace(/\{digit[\+]\}/g, '[0-9_]{1}');
881						return (new RegExp(reg)).test(value);
882					};
883				options = $.extend(true, {}, options, _options);
884
885				if (_options.allowTimes && $.isArray(_options.allowTimes) && _options.allowTimes.length) {
886					options.allowTimes = $.extend(true, [], _options.allowTimes);
887				}
888
889				if (_options.weekends && $.isArray(_options.weekends) && _options.weekends.length) {
890					options.weekends = $.extend(true, [], _options.weekends);
891				}
892
893				if (_options.highlightedDates && $.isArray(_options.highlightedDates) && _options.highlightedDates.length) {
894					$.each(_options.highlightedDates, function (index, value) {
895						var splitData = $.map(value.split(','), $.trim),
896							exDesc,
897							hDate = new HighlightedDate(Date.parseDate(splitData[0], options.formatDate), splitData[1], splitData[2]), // date, desc, style
898							keyDate = hDate.date.dateFormat(options.formatDate);
899						if (highlightedDates[keyDate] !== undefined) {
900							exDesc = highlightedDates[keyDate].desc;
901							if (exDesc && exDesc.length && hDate.desc && hDate.desc.length) {
902								highlightedDates[keyDate].desc = exDesc + "\n" + hDate.desc;
903							}
904						} else {
905							highlightedDates[keyDate] = hDate;
906						}
907					});
908
909					options.highlightedDates = $.extend(true, [], highlightedDates);
910				}
911
912				if (_options.highlightedPeriods && $.isArray(_options.highlightedPeriods) && _options.highlightedPeriods.length) {
913					highlightedDates = $.extend(true, [], options.highlightedDates);
914					$.each(_options.highlightedPeriods, function (index, value) {
915						var splitData = $.map(value.split(','), $.trim),
916							dateTest = Date.parseDate(splitData[0], options.formatDate), // start date
917							dateEnd = Date.parseDate(splitData[1], options.formatDate),
918							desc = splitData[2],
919							hDate,
920							keyDate,
921							exDesc,
922							style = splitData[3];
923
924						while (dateTest <= dateEnd) {
925							hDate = new HighlightedDate(dateTest, desc, style);
926							keyDate = dateTest.dateFormat(options.formatDate);
927							dateTest.setDate(dateTest.getDate() + 1);
928							if (highlightedDates[keyDate] !== undefined) {
929								exDesc = highlightedDates[keyDate].desc;
930								if (exDesc && exDesc.length && hDate.desc && hDate.desc.length) {
931									highlightedDates[keyDate].desc = exDesc + "\n" + hDate.desc;
932								}
933							} else {
934								highlightedDates[keyDate] = hDate;
935							}
936						}
937					});
938
939					options.highlightedDates = $.extend(true, [], highlightedDates);
940				}
941
942				if (_options.disabledDates && $.isArray(_options.disabledDates) && _options.disabledDates.length) {
943					options.disabledDates = $.extend(true, [], _options.disabledDates);
944				}
945
946				if ((options.open || options.opened) && (!options.inline)) {
947					input.trigger('open.xdsoft');
948				}
949
950				if (options.inline) {
951					triggerAfterOpen = true;
952					datetimepicker.addClass('xdsoft_inline');
953					input.after(datetimepicker).hide();
954				}
955
956				if (options.inverseButton) {
957					options.next = 'xdsoft_prev';
958					options.prev = 'xdsoft_next';
959				}
960
961				if (options.datepicker) {
962					datepicker.addClass('active');
963				} else {
964					datepicker.removeClass('active');
965				}
966
967				if (options.timepicker) {
968					timepicker.addClass('active');
969				} else {
970					timepicker.removeClass('active');
971				}
972
973				if (options.value) {
974					_xdsoft_datetime.setCurrentTime(options.value);
975					if (input && input.val) {
976						input.val(_xdsoft_datetime.str);
977					}
978				}
979
980				if (isNaN(options.dayOfWeekStart)) {
981					options.dayOfWeekStart = 0;
982				} else {
983					options.dayOfWeekStart = parseInt(options.dayOfWeekStart, 10) % 7;
984				}
985
986				if (!options.timepickerScrollbar) {
987					timeboxparent.xdsoftScroller('hide');
988				}
989
990				if (options.minDate && /^-(.*)$/.test(options.minDate)) {
991					options.minDate = _xdsoft_datetime.strToDateTime(options.minDate).dateFormat(options.formatDate);
992				}
993
994				if (options.maxDate &&  /^\+(.*)$/.test(options.maxDate)) {
995					options.maxDate = _xdsoft_datetime.strToDateTime(options.maxDate).dateFormat(options.formatDate);
996				}
997
998				applyButton.toggle(options.showApplyButton);
999
1000				mounth_picker
1001					.find('.xdsoft_today_button')
1002						.css('visibility', !options.todayButton ? 'hidden' : 'visible');
1003
1004				mounth_picker
1005					.find('.' + options.prev)
1006						.css('visibility', !options.prevButton ? 'hidden' : 'visible');
1007
1008				mounth_picker
1009					.find('.' + options.next)
1010						.css('visibility', !options.nextButton ? 'hidden' : 'visible');
1011
1012				if (options.mask) {
1013					input.off('keydown.xdsoft');
1014
1015					if (options.mask === true) {
1016						options.mask = options.format
1017							.replace(/Y/g, '9999')
1018							.replace(/F/g, '9999')
1019							.replace(/m/g, '19')
1020							.replace(/d/g, '39')
1021							.replace(/H/g, '29')
1022							.replace(/i/g, '59')
1023							.replace(/s/g, '59');
1024					}
1025
1026					if ($.type(options.mask) === 'string') {
1027						if (!isValidValue(options.mask, input.val())) {
1028							input.val(options.mask.replace(/[0-9]/g, '_'));
1029						}
1030
1031						input.on('keydown.xdsoft', function (event) {
1032							var val = this.value,
1033								key = event.which,
1034								pos,
1035								digit;
1036
1037							if (((key >= KEY0 && key <= KEY9) || (key >= _KEY0 && key <= _KEY9)) || (key === BACKSPACE || key === DEL)) {
1038								pos = getCaretPos(this);
1039								digit = (key !== BACKSPACE && key !== DEL) ? String.fromCharCode((_KEY0 <= key && key <= _KEY9) ? key - KEY0 : key) : '_';
1040
1041								if ((key === BACKSPACE || key === DEL) && pos) {
1042									pos -= 1;
1043									digit = '_';
1044								}
1045
1046								while (/[^0-9_]/.test(options.mask.substr(pos, 1)) && pos < options.mask.length && pos > 0) {
1047									pos += (key === BACKSPACE || key === DEL) ? -1 : 1;
1048								}
1049
1050								val = val.substr(0, pos) + digit + val.substr(pos + 1);
1051								if ($.trim(val) === '') {
1052									val = options.mask.replace(/[0-9]/g, '_');
1053								} else {
1054									if (pos === options.mask.length) {
1055										event.preventDefault();
1056										return false;
1057									}
1058								}
1059
1060								pos += (key === BACKSPACE || key === DEL) ? 0 : 1;
1061								while (/[^0-9_]/.test(options.mask.substr(pos, 1)) && pos < options.mask.length && pos > 0) {
1062									pos += (key === BACKSPACE || key === DEL) ? -1 : 1;
1063								}
1064
1065								if (isValidValue(options.mask, val)) {
1066									this.value = val;
1067									setCaretPos(this, pos);
1068								} else if ($.trim(val) === '') {
1069									this.value = options.mask.replace(/[0-9]/g, '_');
1070								} else {
1071									input.trigger('error_input.xdsoft');
1072								}
1073							} else {
1074								if (([AKEY, CKEY, VKEY, ZKEY, YKEY].indexOf(key) !== -1 && ctrlDown) || [ESC, ARROWUP, ARROWDOWN, ARROWLEFT, ARROWRIGHT, F5, CTRLKEY, TAB, ENTER].indexOf(key) !== -1) {
1075									return true;
1076								}
1077							}
1078
1079							event.preventDefault();
1080							return false;
1081						});
1082					}
1083				}
1084				if (options.validateOnBlur) {
1085					input
1086						.off('blur.xdsoft')
1087						.on('blur.xdsoft', function () {
1088							if (options.allowBlank && !$.trim($(this).val()).length) {
1089								$(this).val(null);
1090								datetimepicker.data('xdsoft_datetime').empty();
1091							} else if (!Date.parseDate($(this).val(), options.format)) {
1092								var splittedHours   = +([$(this).val()[0], $(this).val()[1]].join('')),
1093									splittedMinutes = +([$(this).val()[2], $(this).val()[3]].join(''));
1094
1095								// parse the numbers as 0312 => 03:12
1096								if (!options.datepicker && options.timepicker && splittedHours >= 0 && splittedHours < 24 && splittedMinutes >= 0 && splittedMinutes < 60) {
1097									$(this).val([splittedHours, splittedMinutes].map(function (item) {
1098										return item > 9 ? item : '0' + item;
1099									}).join(':'));
1100								} else {
1101									$(this).val((_xdsoft_datetime.now()).dateFormat(options.format));
1102								}
1103
1104								datetimepicker.data('xdsoft_datetime').setCurrentTime($(this).val());
1105							} else {
1106								datetimepicker.data('xdsoft_datetime').setCurrentTime($(this).val());
1107							}
1108
1109							datetimepicker.trigger('changedatetime.xdsoft');
1110						});
1111				}
1112				options.dayOfWeekStartPrev = (options.dayOfWeekStart === 0) ? 6 : options.dayOfWeekStart - 1;
1113
1114				datetimepicker
1115					.trigger('xchange.xdsoft')
1116					.trigger('afterOpen.xdsoft');
1117			};
1118
1119			datetimepicker
1120				.data('options', options)
1121				.on('mousedown.xdsoft', function (event) {
1122					event.stopPropagation();
1123					event.preventDefault();
1124					yearselect.hide();
1125					monthselect.hide();
1126					return false;
1127				});
1128
1129			//scroll_element = timepicker.find('.xdsoft_time_box');
1130			timeboxparent.append(timebox);
1131			timeboxparent.xdsoftScroller();
1132
1133			datetimepicker.on('afterOpen.xdsoft', function () {
1134				timeboxparent.xdsoftScroller();
1135			});
1136
1137			datetimepicker
1138				.append(datepicker)
1139				.append(timepicker);
1140
1141			if (options.withoutCopyright !== true) {
1142				datetimepicker
1143					.append(xdsoft_copyright);
1144			}
1145
1146			datepicker
1147				.append(mounth_picker)
1148				.append(calendar)
1149				.append(applyButton);
1150
1151			$(options.parentID)
1152				.append(datetimepicker);
1153
1154			XDSoft_datetime = function () {
1155				var _this = this;
1156				_this.now = function (norecursion) {
1157					var d = new Date(),
1158						date,
1159						time;
1160
1161					if (!norecursion && options.defaultDate) {
1162						date = _this.strToDateTime(options.defaultDate);
1163						d.setFullYear(date.getFullYear());
1164						d.setMonth(date.getMonth());
1165						d.setDate(date.getDate());
1166					}
1167
1168					if (options.yearOffset) {
1169						d.setFullYear(d.getFullYear() + options.yearOffset);
1170					}
1171
1172					if (!norecursion && options.defaultTime) {
1173						time = _this.strtotime(options.defaultTime);
1174						d.setHours(time.getHours());
1175						d.setMinutes(time.getMinutes());
1176					}
1177					return d;
1178				};
1179
1180				_this.isValidDate = function (d) {
1181					if (Object.prototype.toString.call(d) !== "[object Date]") {
1182						return false;
1183					}
1184					return !isNaN(d.getTime());
1185				};
1186
1187				_this.setCurrentTime = function (dTime) {
1188					_this.currentTime = (typeof dTime === 'string') ? _this.strToDateTime(dTime) : _this.isValidDate(dTime) ? dTime : _this.now();
1189					datetimepicker.trigger('xchange.xdsoft');
1190				};
1191
1192				_this.empty = function () {
1193					_this.currentTime = null;
1194				};
1195
1196				_this.getCurrentTime = function (dTime) {
1197					return _this.currentTime;
1198				};
1199
1200				_this.nextMonth = function () {
1201
1202					if (_this.currentTime === undefined || _this.currentTime === null) {
1203						_this.currentTime = _this.now();
1204					}
1205
1206					var month = _this.currentTime.getMonth() + 1,
1207						year;
1208					if (month === 12) {
1209						_this.currentTime.setFullYear(_this.currentTime.getFullYear() + 1);
1210						month = 0;
1211					}
1212
1213					year = _this.currentTime.getFullYear();
1214
1215					_this.currentTime.setDate(
1216						Math.min(
1217							new Date(_this.currentTime.getFullYear(), month + 1, 0).getDate(),
1218							_this.currentTime.getDate()
1219						)
1220					);
1221					_this.currentTime.setMonth(month);
1222
1223					if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) {
1224						options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
1225					}
1226
1227					if (year !== _this.currentTime.getFullYear() && $.isFunction(options.onChangeYear)) {
1228						options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
1229					}
1230
1231					datetimepicker.trigger('xchange.xdsoft');
1232					return month;
1233				};
1234
1235				_this.prevMonth = function () {
1236
1237					if (_this.currentTime === undefined || _this.currentTime === null) {
1238						_this.currentTime = _this.now();
1239					}
1240
1241					var month = _this.currentTime.getMonth() - 1;
1242					if (month === -1) {
1243						_this.currentTime.setFullYear(_this.currentTime.getFullYear() - 1);
1244						month = 11;
1245					}
1246					_this.currentTime.setDate(
1247						Math.min(
1248							new Date(_this.currentTime.getFullYear(), month + 1, 0).getDate(),
1249							_this.currentTime.getDate()
1250						)
1251					);
1252					_this.currentTime.setMonth(month);
1253					if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) {
1254						options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
1255					}
1256					datetimepicker.trigger('xchange.xdsoft');
1257					return month;
1258				};
1259
1260				_this.getWeekOfYear = function (datetime) {
1261					var onejan = new Date(datetime.getFullYear(), 0, 1);
1262					return Math.ceil((((datetime - onejan) / 86400000) + onejan.getDay() + 1) / 7);
1263				};
1264
1265				_this.strToDateTime = function (sDateTime) {
1266					var tmpDate = [], timeOffset, currentTime;
1267
1268					if (sDateTime && sDateTime instanceof Date && _this.isValidDate(sDateTime)) {
1269						return sDateTime;
1270					}
1271
1272					tmpDate = /^(\+|\-)(.*)$/.exec(sDateTime);
1273					if (tmpDate) {
1274						tmpDate[2] = Date.parseDate(tmpDate[2], options.formatDate);
1275					}
1276					if (tmpDate  && tmpDate[2]) {
1277						timeOffset = tmpDate[2].getTime() - (tmpDate[2].getTimezoneOffset()) * 60000;
1278						currentTime = new Date((_this.now(true)).getTime() + parseInt(tmpDate[1] + '1', 10) * timeOffset);
1279					} else {
1280						currentTime = sDateTime ? Date.parseDate(sDateTime, options.format) : _this.now();
1281					}
1282
1283					if (!_this.isValidDate(currentTime)) {
1284						currentTime = _this.now();
1285					}
1286
1287					return currentTime;
1288				};
1289
1290				_this.strToDate = function (sDate) {
1291					if (sDate && sDate instanceof Date && _this.isValidDate(sDate)) {
1292						return sDate;
1293					}
1294
1295					var currentTime = sDate ? Date.parseDate(sDate, options.formatDate) : _this.now(true);
1296					if (!_this.isValidDate(currentTime)) {
1297						currentTime = _this.now(true);
1298					}
1299					return currentTime;
1300				};
1301
1302				_this.strtotime = function (sTime) {
1303					if (sTime && sTime instanceof Date && _this.isValidDate(sTime)) {
1304						return sTime;
1305					}
1306					var currentTime = sTime ? Date.parseDate(sTime, options.formatTime) : _this.now(true);
1307					if (!_this.isValidDate(currentTime)) {
1308						currentTime = _this.now(true);
1309					}
1310					return currentTime;
1311				};
1312
1313				_this.str = function () {
1314					return _this.currentTime.dateFormat(options.format);
1315				};
1316				_this.currentTime = this.now();
1317			};
1318
1319			_xdsoft_datetime = new XDSoft_datetime();
1320
1321			applyButton.on('click', function (e) {//pathbrite
1322                e.preventDefault();
1323                datetimepicker.data('changed', true);
1324                _xdsoft_datetime.setCurrentTime(getCurrentValue());
1325                input.val(_xdsoft_datetime.str());
1326                datetimepicker.trigger('close.xdsoft');
1327            });
1328			mounth_picker
1329				.find('.xdsoft_today_button')
1330				.on('mousedown.xdsoft', function () {
1331					datetimepicker.data('changed', true);
1332					_xdsoft_datetime.setCurrentTime(0);
1333					datetimepicker.trigger('afterOpen.xdsoft');
1334				}).on('dblclick.xdsoft', function () {
1335					var currentDate = _xdsoft_datetime.getCurrentTime();
1336					currentDate = new Date(currentDate.getFullYear(),currentDate.getMonth(),currentDate.getDate());
1337					var minDate = _xdsoft_datetime.strToDate(options.minDate);
1338					minDate = new Date(minDate.getFullYear(),minDate.getMonth(),minDate.getDate());
1339					if(currentDate < minDate) {
1340						return;
1341					}
1342					var maxDate = _xdsoft_datetime.strToDate(options.maxDate);
1343					maxDate = new Date(maxDate.getFullYear(),maxDate.getMonth(),maxDate.getDate());
1344					if(currentDate > maxDate) {
1345						return;
1346					}
1347					input.val(_xdsoft_datetime.str());
1348					datetimepicker.trigger('close.xdsoft');
1349				});
1350			mounth_picker
1351				.find('.xdsoft_prev,.xdsoft_next')
1352				.on('mousedown.xdsoft', function () {
1353					var $this = $(this),
1354						timer = 0,
1355						stop = false;
1356
1357					(function arguments_callee1(v) {
1358						if ($this.hasClass(options.next)) {
1359							_xdsoft_datetime.nextMonth();
1360						} else if ($this.hasClass(options.prev)) {
1361							_xdsoft_datetime.prevMonth();
1362						}
1363						if (options.monthChangeSpinner) {
1364							if (!stop) {
1365								timer = setTimeout(arguments_callee1, v || 100);
1366							}
1367						}
1368					}(500));
1369
1370					$([document.body, window]).on('mouseup.xdsoft', function arguments_callee2() {
1371						clearTimeout(timer);
1372						stop = true;
1373						$([document.body, window]).off('mouseup.xdsoft', arguments_callee2);
1374					});
1375				});
1376
1377			timepicker
1378				.find('.xdsoft_prev,.xdsoft_next')
1379				.on('mousedown.xdsoft', function () {
1380					var $this = $(this),
1381						timer = 0,
1382						stop = false,
1383						period = 110;
1384					(function arguments_callee4(v) {
1385						var pheight = timeboxparent[0].clientHeight,
1386							height = timebox[0].offsetHeight,
1387							top = Math.abs(parseInt(timebox.css('marginTop'), 10));
1388						if ($this.hasClass(options.next) && (height - pheight) - options.timeHeightInTimePicker >= top) {
1389							timebox.css('marginTop', '-' + (top + options.timeHeightInTimePicker) + 'px');
1390						} else if ($this.hasClass(options.prev) && top - options.timeHeightInTimePicker >= 0) {
1391							timebox.css('marginTop', '-' + (top - options.timeHeightInTimePicker) + 'px');
1392						}
1393						timeboxparent.trigger('scroll_element.xdsoft_scroller', [Math.abs(parseInt(timebox.css('marginTop'), 10) / (height - pheight))]);
1394						period = (period > 10) ? 10 : period - 10;
1395						if (!stop) {
1396							timer = setTimeout(arguments_callee4, v || period);
1397						}
1398					}(500));
1399					$([document.body, window]).on('mouseup.xdsoft', function arguments_callee5() {
1400						clearTimeout(timer);
1401						stop = true;
1402						$([document.body, window])
1403							.off('mouseup.xdsoft', arguments_callee5);
1404					});
1405				});
1406
1407			xchangeTimer = 0;
1408			// base handler - generating a calendar and timepicker
1409			datetimepicker
1410				.on('xchange.xdsoft', function (event) {
1411					clearTimeout(xchangeTimer);
1412					xchangeTimer = setTimeout(function () {
1413
1414						if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null) {
1415							_xdsoft_datetime.currentTime = _xdsoft_datetime.now();
1416						}
1417
1418						var table =	'',
1419							start = new Date(_xdsoft_datetime.currentTime.getFullYear(), _xdsoft_datetime.currentTime.getMonth(), 1, 12, 0, 0),
1420							i = 0,
1421							j,
1422							today = _xdsoft_datetime.now(),
1423							maxDate = false,
1424							minDate = false,
1425							hDate,
1426							d,
1427							y,
1428							m,
1429							w,
1430							classes = [],
1431							customDateSettings,
1432							newRow = true,
1433							time = '',
1434							h = '',
1435							line_time,
1436							description;
1437
1438						while (start.getDay() !== options.dayOfWeekStart) {
1439							start.setDate(start.getDate() - 1);
1440						}
1441
1442						table += '<table><thead><tr>';
1443
1444						if (options.weeks) {
1445							table += '<th></th>';
1446						}
1447
1448						for (j = 0; j < 7; j += 1) {
1449							table += '<th>' + options.i18n[options.lang].dayOfWeek[(j + options.dayOfWeekStart) % 7] + '</th>';
1450						}
1451
1452						table += '</tr></thead>';
1453						table += '<tbody>';
1454
1455						if (options.maxDate !== false) {
1456							maxDate = _xdsoft_datetime.strToDate(options.maxDate);
1457							maxDate = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate(), 23, 59, 59, 999);
1458						}
1459
1460						if (options.minDate !== false) {
1461							minDate = _xdsoft_datetime.strToDate(options.minDate);
1462							minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate());
1463						}
1464
1465						while (i < _xdsoft_datetime.currentTime.countDaysInMonth() || start.getDay() !== options.dayOfWeekStart || _xdsoft_datetime.currentTime.getMonth() === start.getMonth()) {
1466							classes = [];
1467							i += 1;
1468
1469							d = start.getDate();
1470							y = start.getFullYear();
1471							m = start.getMonth();
1472							w = _xdsoft_datetime.getWeekOfYear(start);
1473							description = '';
1474
1475							classes.push('xdsoft_date');
1476
1477							if (options.beforeShowDay && $.isFunction(options.beforeShowDay.call)) {
1478								customDateSettings = options.beforeShowDay.call(datetimepicker, start);
1479							} else {
1480								customDateSettings = null;
1481							}
1482
1483							if ((maxDate !== false && start > maxDate) || (minDate !== false && start < minDate) || (customDateSettings && customDateSettings[0] === false)) {
1484								classes.push('xdsoft_disabled');
1485							} else if (options.disabledDates.indexOf(start.dateFormat(options.formatDate)) !== -1) {
1486								classes.push('xdsoft_disabled');
1487							}
1488
1489							if (customDateSettings && customDateSettings[1] !== "") {
1490								classes.push(customDateSettings[1]);
1491							}
1492
1493							if (_xdsoft_datetime.currentTime.getMonth() !== m) {
1494								classes.push('xdsoft_other_month');
1495							}
1496
1497							if ((options.defaultSelect || datetimepicker.data('changed')) && _xdsoft_datetime.currentTime.dateFormat(options.formatDate) === start.dateFormat(options.formatDate)) {
1498								classes.push('xdsoft_current');
1499							}
1500
1501							if (today.dateFormat(options.formatDate) === start.dateFormat(options.formatDate)) {
1502								classes.push('xdsoft_today');
1503							}
1504
1505							if (start.getDay() === 0 || start.getDay() === 6 || options.weekends.indexOf(start.dateFormat(options.formatDate)) !== -1) {
1506								classes.push('xdsoft_weekend');
1507							}
1508
1509							if (options.highlightedDates[start.dateFormat(options.formatDate)] !== undefined) {
1510								hDate = options.highlightedDates[start.dateFormat(options.formatDate)];
1511								classes.push(hDate.style === undefined ? 'xdsoft_highlighted_default' : hDate.style);
1512								description = hDate.desc === undefined ? '' : hDate.desc;
1513							}
1514
1515							if (options.beforeShowDay && $.isFunction(options.beforeShowDay)) {
1516								classes.push(options.beforeShowDay(start));
1517							}
1518
1519							if (newRow) {
1520								table += '<tr>';
1521								newRow = false;
1522								if (options.weeks) {
1523									table += '<th>' + w + '</th>';
1524								}
1525							}
1526
1527							table += '<td data-date="' + d + '" data-month="' + m + '" data-year="' + y + '"' + ' class="xdsoft_date xdsoft_day_of_week' + start.getDay() + ' ' + classes.join(' ') + '" title="' + description + '">' +
1528										'<div>' + d + '</div>' +
1529									'</td>';
1530
1531							if (start.getDay() === options.dayOfWeekStartPrev) {
1532								table += '</tr>';
1533								newRow = true;
1534							}
1535
1536							start.setDate(d + 1);
1537						}
1538						table += '</tbody></table>';
1539
1540						calendar.html(table);
1541
1542						mounth_picker.find('.xdsoft_label span').eq(0).text(options.i18n[options.lang].months[_xdsoft_datetime.currentTime.getMonth()]);
1543						mounth_picker.find('.xdsoft_label span').eq(1).text(_xdsoft_datetime.currentTime.getFullYear());
1544
1545						// generate timebox
1546						time = '';
1547						h = '';
1548						m = '';
1549						line_time = function line_time(h, m) {
1550							var now = _xdsoft_datetime.now(), optionDateTime, current_time;
1551							now.setHours(h);
1552							h = parseInt(now.getHours(), 10);
1553							now.setMinutes(m);
1554							m = parseInt(now.getMinutes(), 10);
1555							optionDateTime = new Date(_xdsoft_datetime.currentTime);
1556							optionDateTime.setHours(h);
1557							optionDateTime.setMinutes(m);
1558							classes = [];
1559							if ((options.minDateTime !== false && options.minDateTime > optionDateTime) || (options.maxTime !== false && _xdsoft_datetime.strtotime(options.maxTime).getTime() < now.getTime()) || (options.minTime !== false && _xdsoft_datetime.strtotime(options.minTime).getTime() > now.getTime())) {
1560								classes.push('xdsoft_disabled');
1561							}
1562
1563							current_time = new Date(_xdsoft_datetime.currentTime);
1564							current_time.setHours(parseInt(_xdsoft_datetime.currentTime.getHours(), 10));
1565							current_time.setMinutes(Math[options.roundTime](_xdsoft_datetime.currentTime.getMinutes() / options.step) * options.step);
1566
1567							if ((options.initTime || options.defaultSelect || datetimepicker.data('changed')) && current_time.getHours() === parseInt(h, 10) && (options.step > 59 || current_time.getMinutes() === parseInt(m, 10))) {
1568								if (options.defaultSelect || datetimepicker.data('changed')) {
1569									classes.push('xdsoft_current');
1570								} else if (options.initTime) {
1571									classes.push('xdsoft_init_time');
1572								}
1573							}
1574							if (parseInt(today.getHours(), 10) === parseInt(h, 10) && parseInt(today.getMinutes(), 10) === parseInt(m, 10)) {
1575								classes.push('xdsoft_today');
1576							}
1577							time += '<div class="xdsoft_time ' + classes.join(' ') + '" data-hour="' + h + '" data-minute="' + m + '">' + now.dateFormat(options.formatTime) + '</div>';
1578						};
1579
1580						if (!options.allowTimes || !$.isArray(options.allowTimes) || !options.allowTimes.length) {
1581							for (i = 0, j = 0; i < (options.hours12 ? 12 : 24); i += 1) {
1582								for (j = 0; j < 60; j += options.step) {
1583									h = (i < 10 ? '0' : '') + i;
1584									m = (j < 10 ? '0' : '') + j;
1585									line_time(h, m);
1586								}
1587							}
1588						} else {
1589							for (i = 0; i < options.allowTimes.length; i += 1) {
1590								h = _xdsoft_datetime.strtotime(options.allowTimes[i]).getHours();
1591								m = _xdsoft_datetime.strtotime(options.allowTimes[i]).getMinutes();
1592								line_time(h, m);
1593							}
1594						}
1595
1596						timebox.html(time);
1597
1598						opt = '';
1599						i = 0;
1600
1601						for (i = parseInt(options.yearStart, 10) + options.yearOffset; i <= parseInt(options.yearEnd, 10) + options.yearOffset; i += 1) {
1602							opt += '<div class="xdsoft_option ' + (_xdsoft_datetime.currentTime.getFullYear() === i ? 'xdsoft_current' : '') + '" data-value="' + i + '">' + i + '</div>';
1603						}
1604						yearselect.children().eq(0)
1605												.html(opt);
1606
1607						for (i = parseInt(options.monthStart, 10), opt = ''; i <= parseInt(options.monthEnd, 10); i += 1) {
1608							opt += '<div class="xdsoft_option ' + (_xdsoft_datetime.currentTime.getMonth() === i ? 'xdsoft_current' : '') + '" data-value="' + i + '">' + options.i18n[options.lang].months[i] + '</div>';
1609						}
1610						monthselect.children().eq(0).html(opt);
1611						$(datetimepicker)
1612							.trigger('generate.xdsoft');
1613					}, 10);
1614					event.stopPropagation();
1615				})
1616				.on('afterOpen.xdsoft', function () {
1617					if (options.timepicker) {
1618						var classType, pheight, height, top;
1619						if (timebox.find('.xdsoft_current').length) {
1620							classType = '.xdsoft_current';
1621						} else if (timebox.find('.xdsoft_init_time').length) {
1622							classType = '.xdsoft_init_time';
1623						}
1624						if (classType) {
1625							pheight = timeboxparent[0].clientHeight;
1626							height = timebox[0].offsetHeight;
1627							top = timebox.find(classType).index() * options.timeHeightInTimePicker + 1;
1628							if ((height - pheight) < top) {
1629								top = height - pheight;
1630							}
1631							timeboxparent.trigger('scroll_element.xdsoft_scroller', [parseInt(top, 10) / (height - pheight)]);
1632						} else {
1633							timeboxparent.trigger('scroll_element.xdsoft_scroller', [0]);
1634						}
1635					}
1636				});
1637
1638			timerclick = 0;
1639			calendar
1640				.on('click.xdsoft', 'td', function (xdevent) {
1641					xdevent.stopPropagation();  // Prevents closing of Pop-ups, Modals and Flyouts in Bootstrap
1642					timerclick += 1;
1643					var $this = $(this),
1644						currentTime = _xdsoft_datetime.currentTime;
1645
1646					if (currentTime === undefined || currentTime === null) {
1647						_xdsoft_datetime.currentTime = _xdsoft_datetime.now();
1648						currentTime = _xdsoft_datetime.currentTime;
1649					}
1650
1651					if ($this.hasClass('xdsoft_disabled')) {
1652						return false;
1653					}
1654
1655					currentTime.setDate(1);
1656					currentTime.setFullYear($this.data('year'));
1657					currentTime.setMonth($this.data('month'));
1658					currentTime.setDate($this.data('date'));
1659
1660					datetimepicker.trigger('select.xdsoft', [currentTime]);
1661
1662					input.val(_xdsoft_datetime.str());
1663					if ((timerclick > 1 || (options.closeOnDateSelect === true || (options.closeOnDateSelect === 0 && !options.timepicker))) && !options.inline) {
1664						datetimepicker.trigger('close.xdsoft');
1665					}
1666
1667					if (options.onSelectDate &&	$.isFunction(options.onSelectDate)) {
1668						options.onSelectDate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent);
1669					}
1670
1671					datetimepicker.data('changed', true);
1672					datetimepicker.trigger('xchange.xdsoft');
1673					datetimepicker.trigger('changedatetime.xdsoft');
1674					setTimeout(function () {
1675						timerclick = 0;
1676					}, 200);
1677				});
1678
1679			timebox
1680				.on('click.xdsoft', 'div', function (xdevent) {
1681					xdevent.stopPropagation();
1682					var $this = $(this),
1683						currentTime = _xdsoft_datetime.currentTime;
1684
1685					if (currentTime === undefined || currentTime === null) {
1686						_xdsoft_datetime.currentTime = _xdsoft_datetime.now();
1687						currentTime = _xdsoft_datetime.currentTime;
1688					}
1689
1690					if ($this.hasClass('xdsoft_disabled')) {
1691						return false;
1692					}
1693					currentTime.setHours($this.data('hour'));
1694					currentTime.setMinutes($this.data('minute'));
1695					datetimepicker.trigger('select.xdsoft', [currentTime]);
1696
1697					datetimepicker.data('input').val(_xdsoft_datetime.str());
1698
1699                    if (options.inline !== true && options.closeOnTimeSelect === true) {
1700                        datetimepicker.trigger('close.xdsoft');
1701                    }
1702
1703					if (options.onSelectTime && $.isFunction(options.onSelectTime)) {
1704						options.onSelectTime.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent);
1705					}
1706					datetimepicker.data('changed', true);
1707					datetimepicker.trigger('xchange.xdsoft');
1708					datetimepicker.trigger('changedatetime.xdsoft');
1709				});
1710
1711
1712			datepicker
1713				.on('mousewheel.xdsoft', function (event) {
1714					if (!options.scrollMonth) {
1715						return true;
1716					}
1717					if (event.deltaY < 0) {
1718						_xdsoft_datetime.nextMonth();
1719					} else {
1720						_xdsoft_datetime.prevMonth();
1721					}
1722					return false;
1723				});
1724
1725			input
1726				.on('mousewheel.xdsoft', function (event) {
1727					if (!options.scrollInput) {
1728						return true;
1729					}
1730					if (!options.datepicker && options.timepicker) {
1731						current_time_index = timebox.find('.xdsoft_current').length ? timebox.find('.xdsoft_current').eq(0).index() : 0;
1732						if (current_time_index + event.deltaY >= 0 && current_time_index + event.deltaY < timebox.children().length) {
1733							current_time_index += event.deltaY;
1734						}
1735						if (timebox.children().eq(current_time_index).length) {
1736							timebox.children().eq(current_time_index).trigger('mousedown');
1737						}
1738						return false;
1739					}
1740					if (options.datepicker && !options.timepicker) {
1741						datepicker.trigger(event, [event.deltaY, event.deltaX, event.deltaY]);
1742						if (input.val) {
1743							input.val(_xdsoft_datetime.str());
1744						}
1745						datetimepicker.trigger('changedatetime.xdsoft');
1746						return false;
1747					}
1748				});
1749
1750			datetimepicker
1751				.on('changedatetime.xdsoft', function (event) {
1752					if (options.onChangeDateTime && $.isFunction(options.onChangeDateTime)) {
1753						var $input = datetimepicker.data('input');
1754						options.onChangeDateTime.call(datetimepicker, _xdsoft_datetime.currentTime, $input, event);
1755						delete options.value;
1756						$input.trigger('change');
1757					}
1758				})
1759				.on('generate.xdsoft', function () {
1760					if (options.onGenerate && $.isFunction(options.onGenerate)) {
1761						options.onGenerate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
1762					}
1763					if (triggerAfterOpen) {
1764						datetimepicker.trigger('afterOpen.xdsoft');
1765						triggerAfterOpen = false;
1766					}
1767				})
1768				.on('click.xdsoft', function (xdevent) {
1769					xdevent.stopPropagation();
1770				});
1771
1772			current_time_index = 0;
1773
1774			setPos = function () {
1775				var offset = datetimepicker.data('input').offset(), top = offset.top + datetimepicker.data('input')[0].offsetHeight - 1, left = offset.left, position = "absolute";
1776				if (options.fixed) {
1777					top -= $(window).scrollTop();
1778					left -= $(window).scrollLeft();
1779					position = "fixed";
1780				} else {
1781					if (top + datetimepicker[0].offsetHeight > $(window).height() + $(window).scrollTop()) {
1782						top = offset.top - datetimepicker[0].offsetHeight + 1;
1783					}
1784					if (top < 0) {
1785						top = 0;
1786					}
1787					if (left + datetimepicker[0].offsetWidth > $(window).width()) {
1788						left = $(window).width() - datetimepicker[0].offsetWidth;
1789					}
1790				}
1791				var node = datetimepicker[0]
1792				do {
1793					node = node.parentNode;
1794					if(window.getComputedStyle(node).getPropertyValue('position') === 'relative' && $(window).width() >= node.offsetWidth) {
1795						left = left - (($(window).width() - node.offsetWidth)/2)
1796						break
1797					}
1798				} while(node.nodeName != 'HTML')
1799				datetimepicker.css({
1800					left: left,
1801					top: top,
1802					position: position
1803				});
1804			};
1805			datetimepicker
1806				.on('open.xdsoft', function (event) {
1807					var onShow = true;
1808					if (options.onShow && $.isFunction(options.onShow)) {
1809						onShow = options.onShow.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event);
1810					}
1811					if (onShow !== false) {
1812						datetimepicker.show();
1813						setPos();
1814						$(window)
1815							.off('resize.xdsoft', setPos)
1816							.on('resize.xdsoft', setPos);
1817
1818						if (options.closeOnWithoutClick) {
1819							$([document.body, window]).on('mousedown.xdsoft', function arguments_callee6() {
1820								datetimepicker.trigger('close.xdsoft');
1821								$([document.body, window]).off('mousedown.xdsoft', arguments_callee6);
1822							});
1823						}
1824					}
1825				})
1826				.on('close.xdsoft', function (event) {
1827					var onClose = true;
1828					mounth_picker
1829						.find('.xdsoft_month,.xdsoft_year')
1830							.find('.xdsoft_select')
1831								.hide();
1832					if (options.onClose && $.isFunction(options.onClose)) {
1833						onClose = options.onClose.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event);
1834					}
1835					if (onClose !== false && !options.opened && !options.inline) {
1836						datetimepicker.hide();
1837					}
1838					event.stopPropagation();
1839				})
1840				.on('toggle.xdsoft', function (event) {
1841					if (datetimepicker.is(':visible')) {
1842						datetimepicker.trigger('close.xdsoft');
1843					} else {
1844						datetimepicker.trigger('open.xdsoft');
1845					}
1846				})
1847				.data('input', input);
1848
1849			timer = 0;
1850			timer1 = 0;
1851
1852			datetimepicker.data('xdsoft_datetime', _xdsoft_datetime);
1853			datetimepicker.setOptions(options);
1854
1855			function getCurrentValue() {
1856				var ct = false, time;
1857
1858				if (options.startDate) {
1859					ct = _xdsoft_datetime.strToDate(options.startDate);
1860				} else {
1861					ct = options.value || ((input && input.val && input.val()) ? input.val() : '');
1862					if (ct) {
1863						ct = _xdsoft_datetime.strToDateTime(ct);
1864					} else if (options.defaultDate) {
1865						ct = _xdsoft_datetime.strToDateTime(options.defaultDate);
1866						if (options.defaultTime) {
1867							time = _xdsoft_datetime.strtotime(options.defaultTime);
1868							ct.setHours(time.getHours());
1869							ct.setMinutes(time.getMinutes());
1870						}
1871					}
1872				}
1873
1874				if (ct && _xdsoft_datetime.isValidDate(ct)) {
1875					datetimepicker.data('changed', true);
1876				} else {
1877					ct = '';
1878				}
1879
1880				return ct || 0;
1881			}
1882
1883			_xdsoft_datetime.setCurrentTime(getCurrentValue());
1884
1885			input
1886				.data('xdsoft_datetimepicker', datetimepicker)
1887				.on('open.xdsoft focusin.xdsoft mousedown.xdsoft', function (event) {
1888					if (input.is(':disabled') || (input.data('xdsoft_datetimepicker').is(':visible') && options.closeOnInputClick)) {
1889						return;
1890					}
1891					clearTimeout(timer);
1892					timer = setTimeout(function () {
1893						if (input.is(':disabled')) {
1894							return;
1895						}
1896
1897						triggerAfterOpen = true;
1898						_xdsoft_datetime.setCurrentTime(getCurrentValue());
1899
1900						datetimepicker.trigger('open.xdsoft');
1901					}, 100);
1902				})
1903				.on('keydown.xdsoft', function (event) {
1904					var val = this.value, elementSelector,
1905						key = event.which;
1906					if ([ENTER].indexOf(key) !== -1 && options.enterLikeTab) {
1907						elementSelector = $("input:visible,textarea:visible");
1908						datetimepicker.trigger('close.xdsoft');
1909						elementSelector.eq(elementSelector.index(this) + 1).focus();
1910						return false;
1911					}
1912					if ([TAB].indexOf(key) !== -1) {
1913						datetimepicker.trigger('close.xdsoft');
1914						return true;
1915					}
1916				});
1917		};
1918		destroyDateTimePicker = function (input) {
1919			var datetimepicker = input.data('xdsoft_datetimepicker');
1920			if (datetimepicker) {
1921				datetimepicker.data('xdsoft_datetime', null);
1922				datetimepicker.remove();
1923				input
1924					.data('xdsoft_datetimepicker', null)
1925					.off('.xdsoft');
1926				$(window).off('resize.xdsoft');
1927				$([window, document.body]).off('mousedown.xdsoft');
1928				if (input.unmousewheel) {
1929					input.unmousewheel();
1930				}
1931			}
1932		};
1933		$(document)
1934			.off('keydown.xdsoftctrl keyup.xdsoftctrl')
1935			.on('keydown.xdsoftctrl', function (e) {
1936				if (e.keyCode === CTRLKEY) {
1937					ctrlDown = true;
1938				}
1939			})
1940			.on('keyup.xdsoftctrl', function (e) {
1941				if (e.keyCode === CTRLKEY) {
1942					ctrlDown = false;
1943				}
1944			});
1945		return this.each(function () {
1946			var datetimepicker = $(this).data('xdsoft_datetimepicker'), $input;
1947			if (datetimepicker) {
1948				if ($.type(opt) === 'string') {
1949					switch (opt) {
1950					case 'show':
1951						$(this).select().focus();
1952						datetimepicker.trigger('open.xdsoft');
1953						break;
1954					case 'hide':
1955						datetimepicker.trigger('close.xdsoft');
1956						break;
1957					case 'toggle':
1958						datetimepicker.trigger('toggle.xdsoft');
1959						break;
1960					case 'destroy':
1961						destroyDateTimePicker($(this));
1962						break;
1963					case 'reset':
1964						this.value = this.defaultValue;
1965						if (!this.value || !datetimepicker.data('xdsoft_datetime').isValidDate(Date.parseDate(this.value, options.format))) {
1966							datetimepicker.data('changed', false);
1967						}
1968						datetimepicker.data('xdsoft_datetime').setCurrentTime(this.value);
1969						break;
1970					case 'validate':
1971						$input = datetimepicker.data('input');
1972						$input.trigger('blur.xdsoft');
1973						break;
1974					}
1975				} else {
1976					datetimepicker
1977						.setOptions(opt);
1978				}
1979				return 0;
1980			}
1981			if ($.type(opt) !== 'string') {
1982				if (!options.lazyInit || options.open || options.inline) {
1983					createDateTimePicker($(this));
1984				} else {
1985					lazyInit($(this));
1986				}
1987			}
1988		});
1989	};
1990	$.fn.datetimepicker.defaults = default_options;
1991}(jQuery));
1992
1993function HighlightedDate(date, desc, style) {
1994	"use strict";
1995	this.date = date;
1996	this.desc = desc;
1997	this.style = style;
1998}
1999
2000(function () {
2001
2002/*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh)
2003 * Licensed under the MIT License (LICENSE.txt).
2004 *
2005 * Version: 3.1.12
2006 *
2007 * Requires: jQuery 1.2.2+
2008 */
2009!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1
vendor: 2,754 bytes, lines 2009-2017
2009),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
2010
2011// Parse and Format Library
2012//http://www.xaprb.com/blog/2005/12/12/javascript-closures-for-runtime-efficiency/
2013/*
2014 * Copyright (C) 2004 Baron Schwartz <baron at sequent dot org>
2015 *
2016 * This program is free software; you can redistribute it and/or modify it
2017 * under the terms of the GNU Lesser General Public License as published by the
2018 * Free Software Foundation, version 2.1.
2019 *
2020 * This program is distributed in the hope that it will be useful, but WITHOUT
2021 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
2022 * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
2023 * details.
2024 */
2025Date.parseFunctions={count:0};Date.parseRegexes=[];Date.formatFunctions={count:0};Date.prototype.dateFormat=function(b){if(b=="unixtime"){return parseInt(this.getTime()/1000);}if(Date.formatFunctions[b]==null){Date.createNewFormat(b);}var a=Date.formatFunctions[b];return this[a]();};Date.createNewFormat=function(format){var funcName="format"+Date.formatFunctions.count++;Date.formatFunctions[format]=funcName;var codePrefix="Date.prototype."+funcName+" = function() {return ";var code="";var special=false;var ch="";for(var i=0;i<format.length;++i){ch=format.charAt(i);if(!special&&ch=="\\"){special=true;}else{if(special){special=false;code+="'"+String.escape(ch)+"' + ";}else{code+=Date.getFormatCode(ch);}}}if(code.length==0){code="\"\"";}else{code=code.substring(0,code.length-3);}eval(codePrefix+code+";}");};Date.getFormatCode=function(a){switch(a){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(a)+"' + ";}};Date.parseDate=function(a,c){if(c=="unixtime"){return new Date(!isNaN(parseInt(a))?parseInt(a)*1000:0);}if(Date.parseFunctions[c]==null){Date.createParser(c);}var b=Date.parseFunctions[c];return Date[b](a);};Date.createParser=function(format){var funcName="parse"+Date.parseFunctions.count++;var regexNum=Date.parseRegexes.length;var currentGroup=1;Date.parseFunctions[format]=funcName;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) {";var regex="";var special=false;var ch="";for(var i=0;i<format.length;++i){ch=format.charAt(i);if(!special&&ch=="\\"){special=true;}else{if(special){special=false;regex+=String.escape(ch);}else{obj=Date.formatCodeToRegex(ch,currentGroup);currentGroup+=obj.g;regex+=obj.s;if(obj.g&&obj.c){code+=obj.c;}}}}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(b,a){switch(b){case"D":return{g:0,c:null,
2025s:"(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)"};case"j":case"d":return{g:1,c:"d = parseInt(results["+a+"], 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["+a+"], 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["+a+"].substring(0, 3)], 10);\n",s:"("+Date.monthNames.join("|")+")"};case"M":return{g:1,c:"m = parseInt(Date.monthNumbers[results["+a+"]], 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["+a+"], 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["+a+"], 10);\n",s:"(\\d{4})"};case"y":return{g:1,c:"var ty = parseInt(results["+a+"], 10);\ny = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"};case"a":return{g:1,c:"if (results["+a+"] == 'am') {\nif (h == 12) { h = 0; }\n} else { if (h < 12) { h += 12; }}",s:"(am|pm)"};case"A":return{g:1,c:"if (results["+a+"] == '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["+a+"], 10);\n",s:"(\\d{1,2})"};case"i":return{g:1,c:"i = parseInt(results["+a+"], 10);\n",s:"(\\d{2})"};case"s":return{g:1,c:"s = parseInt(results["+a+"], 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(b)};}};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 a=0;Date.daysInMonth[1]=this.isLeapYear()?29:28;for(var b=0;b<this.getMonth();++b){a+=Date.daysInMonth[b];}return a+this.getDate();};Date.prototype.getWeekOfYear=function(){var b=this.getDayOfYear()+(4-this.getDay());var a=new Date(this.getFullYear(),0,1);var c=(7-a.getDay()+4);return String.leftPad(Math.ceil((b-c)/7)+1,2,"0");};Date.prototype.isLeapYear=function(){var a=this.getFullYear();return((a&3)==0&&(a%100||(a%400==0&&a)));};Date.prototype.getFirstDayOfMonth=function(){var a=(this.getDay()-(this.getDate()-1))%7;return(a<0)?(a+7):a;};Date.prototype.getLastDayOfMonth=function(){var a=(this.getDay()+(Date.daysInMonth[this.getMonth()]-this.getDate()))%7;return(a<0)?(a+7):a;};Date.prototype.getDaysInMonth=function(){Date.daysInMonth[1]=this.isLeapYear()?29:28;return 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(a){return a.replace(/('|\\)/g,"\\$1");};String.leftPad=function(d,b,c){var a=new String(d);if(c==null){c=" ";}while(a.length<b){a=c+a;}return a;};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"};
2026}());

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.