PageSourceSearch

https://www.thefastpark.com/FPScript/jquery.datetimepicker.full.js

js thefastpark.com collected 2026-09-24 10:19:51 UTC 135,761 bytes, 3,246 lines download raw bytes

1/*!
2 * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2015
3 * @version 1.3.3
4 *
5 * Date formatter utility library that allows formatting date/time variables or Date objects using PHP DateTime format.
6 * @see http://php.net/manual/en/function.date.php
7 *
8 * For more JQuery plugins visit http://plugins.krajee.com
9 * For more Yii related demos visit http://demos.krajee.com
10 */
11var DateFormatter;
12(function () {
13    "use strict";
14
15    var _compare, _lpad, _extend, defaultSettings, DAY, HOUR;
16    DAY = 1000 * 60 * 60 * 24;
17    HOUR = 3600;
18
19    _compare = function (str1, str2) {
20        return typeof (str1) === 'string' && typeof (str2) === 'string' && str1.toLowerCase() === str2.toLowerCase();
21    };
22    _lpad = function (value, length, char) {
23        var chr = char || '0', val = value.toString();
24        return val.length < length ? _lpad(chr + val, length) : val;
25    };
26    _extend = function (out) {
27        var i, obj;
28        out = out || {};
29        for (i = 1; i < arguments.length; i++) {
30            obj = arguments[i];
31            if (!obj) {
32                continue;
33            }
34            for (var key in obj) {
35                if (obj.hasOwnProperty(key)) {
36                    if (typeof obj[key] === 'object') {
37                        _extend(out[key], obj[key]);
38                    } else {
39                        out[key] = obj[key];
40                    }
41                }
42            }
43        }
44        return out;
45    };
46    defaultSettings = {
47        dateSettings: {
48            days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
49            daysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
50            months: [
51                'January', 'February', 'March', 'April', 'May', 'June', 'July',
52                'August', 'September', 'October', 'November', 'December'
53            ],
54            monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
55            meridiem: ['AM', 'PM'],
56            ordinal: function (number) {
57                var n = number % 10, suffixes = { 1: 'st', 2: 'nd', 3: 'rd' };
58                return Math.floor(number % 100 / 10) === 1 || !suffixes[n] ? 'th' : suffixes[n];
59            }
60        },
61        separators: /[ \-+\/\.T:@]/g,
62        validParts: /[dDjlNSwzWFmMntLoYyaABgGhHisueTIOPZcrU]/g,
63        intParts: /[djwNzmnyYhHgGis]/g,
64        tzParts: /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
65        tzClip: /[^-+\dA-Z]/g
66    };
67
68    DateFormatter = function (options) {
69        var self = this, config = _extend(defaultSettings, options);
70        self.dateSettings = config.dateSettings;
71        self.separators = config.separators;
72        self.validParts = config.validParts;
73        self.intParts = config.intParts;
74        self.tzParts = config.tzParts;
75        self.tzClip = config.tzClip;
76    };
77
78    DateFormatter.prototype = {
79        constructor: DateFormatter,
80        parseDate: function (vDate, vFormat) {
81            var self = this, vFormatParts, vDateParts, i, vDateFlag = false, vTimeFlag = false, vDatePart, iDatePart,
82                vSettings = self.dateSettings, vMonth, vMeriIndex, vMeriOffset, len, mer,
83                out = { date: null, year: null, month: null, day: null, hour: 0, min: 0, sec: 0 };
84            if (!vDate) {
85                return undefined;
86            }
87            if (vDate instanceof Date) {
88                return vDate;
89            }
90            if (typeof vDate === 'number') {
91                return new Date(vDate);
92            }
93            if (vFormat === 'U') {
94                i = parseInt(vDate);
95                return i ? new Date(i * 1000) : vDate;
96            }
97            if (typeof vDate !== 'string') {
98                return '';
99            }
100            vFormatParts = vFormat.match(self.validParts);
101            if (!vFormatParts || vFormatParts.length === 0) {
102                throw new Error("Invalid date format definition.");
103            }
104            vDateParts = vDate.replace(self.separators, '\0').split('\0');
105            for (i = 0; i < vDateParts.length; i++) {
106                vDatePart = vDateParts[i];
107                iDatePart = parseInt(vDatePart);
108                switch (vFormatParts[i]) {
109                    case 'y':
110                    case 'Y':
111                        len = vDatePart.length;
112                        if (len === 2) {
113                            out.year = parseInt((iDatePart < 70 ? '20' : '19') + vDatePart);
114                        } else if (len === 4) {
115                            out.year = iDatePart;
116                        }
117                        vDateFlag = true;
118                        break;
119                    case 'm':
120                    case 'n':
121                    case 'M':
122                    case 'F':
123                        if (isNaN(vDatePart)) {
124                            vMonth = vSettings.monthsShort.indexOf(vDatePart);
125                            if (vMonth > -1) {
126                                out.month = vMonth + 1;
127                            }
128                            vMonth = vSettings.months.indexOf(vDatePart);
129                            if (vMonth > -1) {
130                                out.month = vMonth + 1;
131                            }
132                        } else {
133                            if (iDatePart >= 1 && iDatePart <= 12) {
134                                out.month = iDatePart;
135                            }
136                        }
137                        vDateFlag = true;
138                        break;
139                    case 'd':
140                    case 'j':
141                        if (iDatePart >= 1 && iDatePart <= 31) {
142                            out.day = iDatePart;
143                        }
144                        vDateFlag = true;
145                        break;
146                    case 'g':
147                    case 'h':
148                        vMeriIndex = (vFormatParts.indexOf('a') > -1) ? vFormatParts.indexOf('a') :
149                            (vFormatParts.indexOf('A') > -1) ? vFormatParts.indexOf('A') : -1;
150                        mer = vDateParts[vMeriIndex];
151                        if (vMeriIndex > -1) {
152                            vMeriOffset = _compare(mer, vSettings.meridiem[0]) ? 0 :
153                                (_compare(mer, vSettings.meridiem[1]) ? 12 : -1);
154                            if (iDatePart >= 1 && iDatePart <= 12 && vMeriOffset > -1) {
155                                out.hour = iDatePart + vMeriOffset;
156                            } else if (iDatePart >= 0 && iDatePart <= 23) {
157                                out.hour = iDatePart;
158                            }
159                        } else if (iDatePart >= 0 && iDatePart <= 23) {
160                            out.hour = iDatePart;
161                        }
162                        vTimeFlag = true;
163                        break;
164                    case 'G':
165                    case 'H':
166                        if (iDatePart >= 0 && iDatePart <= 23) {
167                            out.hour = iDatePart;
168                        }
169                        vTimeFlag = true;
170                        break;
171                    case 'i':
172                        if (iDatePart >= 0 && iDatePart <= 59) {
173                            out.min = iDatePart;
174                        }
175                        vTimeFlag = true;
176                        break;
177                    case 's':
178                        if (iDatePart >= 0 && iDatePart <= 59) {
179                            out.sec = iDatePart;
180                        }
181                        vTimeFlag = true;
182                        break;
183                }
184            }
185            if (vDateFlag === true && out.year && out.month && out.day) {
186                out.date = new Date(out.year, out.month - 1, out.day, out.hour, out.min, out.sec, 0);
187            } else {
188                if (vTimeFlag !== true) {
189                    return false;
190                }
191                out.date = new Date(0, 0, 0, out.hour, out.min, out.sec, 0);
192            }
193            return out.date;
194        },
195        guessDate: function (vDateStr, vFormat) {
196            if (typeof vDateStr !== 'string') {
197                return vDateStr;
198            }
199            var self = this, vParts = vDateStr.replace(self.separators, '\0').split('\0'), vPattern = /^[djmn]/g,
200                vFormatParts = vFormat.match(self.validParts), vDate = new Date(), vDigit = 0, vYear, i, iPart, iSec;
201
202            if (!vPattern.test(vFormatParts[0])) {
203                return vDateStr;
204            }
205
206            for (i = 0; i < vParts.length; i++) {
207                vDigit = 2;
208                iPart = vParts[i];
209                iSec = parseInt(iPart.substr(0, 2));
210                switch (i) {
211                    case 0:
212                        if (vFormatParts[0] === 'm' || vFormatParts[0] === 'n') {
213                            vDate.setMonth(iSec - 1);
214                        } else {
215                            vDate.setDate(iSec);
216                        }
217                        break;
218                    case 1:
219                        if (vFormatParts[0] === 'm' || vFormatParts[0] === 'n') {
220                            vDate.setDate(iSec);
221                        } else {
222                            vDate.setMonth(iSec - 1);
223                        }
224                        break;
225                    case 2:
226                        vYear = vDate.getFullYear();
227                        if (iPart.length < 4) {
228                            vDate.setFullYear(parseInt(vYear.toString().substr(0, 4 - iPart.length) + iPart));
229                            vDigit = iPart.length;
230                        } else {
231                            vDate.setFullYear = parseInt(iPart.substr(0, 4));
232                            vDigit = 4;
233                        }
234                        break;
235                    case 3:
236                        vDate.setHours(iSec);
237                        break;
238                    case 4:
239                        vDate.setMinutes(iSec);
240                        break;
241                    case 5:
242                        vDate.setSeconds(iSec);
243                        break;
244                }
245                if (iPart.substr(vDigit).length > 0) {
246                    vParts.splice(i + 1, 0, iPart.substr(vDigit));
247                }
248            }
249            return vDate;
250        },
251        parseFormat: function (vChar, vDate) {
252            var self = this, vSettings = self.dateSettings, fmt, backspace = /\\?(.?)/gi, doFormat = function (t, s) {
253                return fmt[t] ? fmt[t]() : s;
254            };
255            fmt = {
256                /////////
257                // DAY //
258                /////////
259                /**
260                 * Day of month with leading 0: `01..31`
261                 * @return {string}
262                 */
263                d: function () {
264                    return _lpad(fmt.j(), 2);
265                },
266                /**
267                 * Shorthand day name: `Mon...Sun`
268                 * @return {string}
269                 */
270                D: function () {
271                    return vSettings.daysShort[fmt.w()];
272                },
273                /**
274                 * Day of month: `1..31`
275                 * @return {number}
276                 */
277                j: function () {
278                    return vDate.getDate();
279                },
280                /**
281                 * Full day name: `Monday...Sunday`
282                 * @return {number}
283                 */
284                l: function () {
285                    return vSettings.days[fmt.w()];
286                },
287                /**
288                 * ISO-8601 day of week: `1[Mon]..7[Sun]`
289                 * @return {number}
290                 */
291                N: function () {
292                    return fmt.w() || 7;
293                },
294                /**
295                 * Day of week: `0[Sun]..6[Sat]`
296                 * @return {number}
297                 */
298                w: function () {
299                    return vDate.getDay();
300                },
301                /**
302                 * Day of year: `0..365`
303                 * @return {number}
304                 */
305                z: function () {
306                    var a = new Date(fmt.Y(), fmt.n() - 1, fmt.j()), b = new Date(fmt.Y(), 0, 1);
307                    return Math.round((a - b) / DAY);
308                },
309
310                //////////
311                // WEEK //
312                //////////
313                /**
314                 * ISO-8601 week number
315                 * @return {number}
316                 */
317                W: function () {
318                    var a = new Date(fmt.Y(), fmt.n() - 1, fmt.j() - fmt.N() + 3), b = new Date(a.getFullYear(), 0, 4);
319                    return _lpad(1 + Math.round((a - b) / DAY / 7), 2);
320                },
321
322                ///////////
323                // MONTH //
324                ///////////
325                /**
326                 * Full month name: `January...December`
327                 * @return {string}
328                 */
329                F: function () {
330                    return vSettings.months[vDate.getMonth()];
331                },
332                /**
333                 * Month w/leading 0: `01..12`
334                 * @return {string}
335                 */
336                m: function () {
337                    return _lpad(fmt.n(), 2);
338                },
339                /**
340                 * Shorthand month name; `Jan...Dec`
341                 * @return {string}
342                 */
343                M: function () {
344                    return vSettings.monthsShort[vDate.getMonth()];
345                },
346                /**
347                 * Month: `1...12`
348                 * @return {number}
349                 */
350                n: function () {
351                    return vDate.getMonth() + 1;
352                },
353                /**
354                 * Days in month: `28...31`
355                 * @return {number}
356                 */
357                t: function () {
358                    return (new Date(fmt.Y(), fmt.n(), 0)).getDate();
359                },
360
361                //////////
362                // YEAR //
363                //////////
364                /**
365                 * Is leap year? `0 or 1`
366                 * @return {number}
367                 */
368                L: function () {
369                    var Y = fmt.Y();
370                    return (Y % 4 === 0 && Y % 100 !== 0 || Y % 400 === 0) ? 1 : 0;
371                },
372                /**
373                 * ISO-8601 year
374                 * @return {number}
375                 */
376                o: function () {
377                    var n = fmt.n(), W = fmt.W(), Y = fmt.Y();
378                    return Y + (n === 12 && W < 9 ? 1 : n === 1 && W > 9 ? -1 : 0);
379                },
380                /**
381                 * Full year: `e.g. 1980...2010`
382                 * @return {number}
383                 */
384                Y: function () {
385                    return vDate.getFullYear();
386                },
387                /**
388                 * Last two digits of year: `00...99`
389                 * @return {string}
390                 */
391                y: function () {
392                    return fmt.Y().toString().slice(-2);
393                },
394
395                //////////
396                // TIME //
397                //////////
398                /**
399                 * Meridian lower: `am or pm`
400                 * @return {string}
401                 */
402                a: function () {
403                    return fmt.A().toLowerCase();
404                },
405                /**
406                 * Meridian upper: `AM or PM`
407                 * @return {string}
408                 */
409                A: function () {
410                    var n = fmt.G() < 12 ? 0 : 1;
411                    return vSettings.meridiem[n];
412                },
413                /**
414                 * Swatch Internet time: `000..999`
415                 * @return {string}
416                 */
417                B: function () {
418                    var H = vDate.getUTCHours() * HOUR, i = vDate.getUTCMinutes() * 60, s = vDate.getUTCSeconds();
419                    return _lpad(Math.floor((H + i + s + HOUR) / 86.4) % 1000, 3);
420                },
421                /**
422                 * 12-Hours: `1..12`
423                 * @return {number}
424                 */
425                g: function () {
426                    return fmt.G() % 12 || 12;
427                },
428                /**
429                 * 24-Hours: `0..23`
430                 * @return {number}
431                 */
432                G: function () {
433                    return vDate.getHours();
434                },
435                /**
436                 * 12-Hours with leading 0: `01..12`
437                 * @return {string}
438                 */
439                h: function () {
440                    return _lpad(fmt.g(), 2);
441                },
442                /**
443                 * 24-Hours w/leading 0: `00..23`
444                 * @return {string}
445                 */
446                H: function () {
447                    return _lpad(fmt.G(), 2);
448                },
449                /**
450                 * Minutes w/leading 0: `00..59`
451                 * @return {string}
452                 */
453                i: function () {
454                    return _lpad(vDate.getMinutes(), 2);
455                },
456                /**
457                 * Seconds w/leading 0: `00..59`
458                 * @return {string}
459                 */
460                s: function () {
461                    return _lpad(vDate.getSeconds(), 2);
462                },
463                /**
464                 * Microseconds: `000000-999000`
465                 * @return {string}
466                 */
467                u: function () {
468                    return _lpad(vDate.getMilliseconds() * 1000, 6);
469                },
470
471                //////////////
472                // TIMEZONE //
473                //////////////
474                /**
475                 * Timezone identifier: `e.g. Atlantic/Azores, ...`
476                 * @return {string}
477                 */
478                e: function () {
479                    var str = /\((.*)\)/.exec(String(vDate))[1];
480                    return str || 'Coordinated Universal Time';
481                },
482                /**
483                 * Timezone abbreviation: `e.g. EST, MDT, ...`
484                 * @return {string}
485                 */
486                T: function () {
487                    var str = (String(vDate).match(self.tzParts) || [""]).pop().replace(self.tzClip, "");
488                    return str || 'UTC';
489                },
490                /**
491                 * DST observed? `0 or 1`
492                 * @return {number}
493                 */
494                I: function () {
495                    var a = new Date(fmt.Y(), 0), c = Date.UTC(fmt.Y(), 0),
496                        b = new Date(fmt.Y(), 6), d = Date.UTC(fmt.Y(), 6);
497                    return ((a - c) !== (b - d)) ? 1 : 0;
498                },
499                /**
500                 * Difference to GMT in hour format: `e.g. +0200`
501                 * @return {string}
502                 */
503                O: function () {
504                    var tzo = vDate.getTimezoneOffset(), a = Math.abs(tzo);
505                    return (tzo > 0 ? '-' : '+') + _lpad(Math.floor(a / 60) * 100 + a % 60, 4);
506                },
507                /**
508                 * Difference to GMT with colon: `e.g. +02:00`
509                 * @return {string}
510                 */
511                P: function () {
512                    var O = fmt.O();
513                    return (O.substr(0, 3) + ':' + O.substr(3, 2));
514                },
515                /**
516                 * Timezone offset in seconds: `-43200...50400`
517                 * @return {number}
518                 */
519                Z: function () {
520                    return -vDate.getTimezoneOffset() * 60;
521                },
522
523                ////////////////////
524                // FULL DATE TIME //
525                ////////////////////
526                /**
527                 * ISO-8601 date
528                 * @return {string}
529                 */
530                c: function () {
531                    return 'Y-m-d\\TH:i:sP'.replace(backspace, doFormat);
532                },
533                /**
534                 * RFC 2822 date
535                 * @return {string}
536                 */
537                r: function () {
538                    return 'D, d M Y H:i:s O'.replace(backspace, doFormat);
539                },
540                /**
541                 * Seconds since UNIX epoch
542                 * @return {number}
543                 */
544                U: function () {
545                    return vDate.getTime() / 1000 || 0;
546                }
547            };
548            return doFormat(vChar, vChar);
549        },
550        formatDate: function (vDate, vFormat) {
551            var self = this, i, n, len, str, vChar, vDateStr = '';
552            if (typeof vDate === 'string') {
553                vDate = self.parseDate(vDate, vFormat);
554                if (vDate === false) {
555                    return false;
556                }
557            }
558            if (vDate instanceof Date) {
559                len = vFormat.length;
560                for (i = 0; i < len; i++) {
561                    vChar = vFormat.charAt(i);
562                    if (vChar === 'S') {
563                        continue;
564                    }
565                    str = self.parseFormat(vChar, vDate);
566                    if (i !== (len - 1) && self.intParts.test(vChar) && vFormat.charAt(i + 1) === 'S') {
567                        n = parseInt(str);
568                        str += self.dateSettings.ordinal(n);
569                    }
570                    vDateStr += str;
571                }
572                return vDateStr;
573            }
574            return '';
575        }
576    };
577})();/**
578 * @preserve jQuery DateTimePicker plugin v2.5.4
579 * @homepage http://xdsoft.net/jqplugins/datetimepicker/
580 * @author Chupurnov Valeriy (<[email protected]>)
581 */
582/*global DateFormatter, document,window,jQuery,setTimeout,clearTimeout,HighlightedDate,getCurrentValue*/
583; (function (factory) {
584    if (typeof define === 'function' && define.amd) {
585        // AMD. Register as an anonymous module.
586        define(['jquery', 'jquery-mousewheel'], factory);
587    } else if (typeof exports === 'object') {
588        // Node/CommonJS style for Browserify
589        module.exports = factory;
590    } else {
591        // Browser globals
592        factory(jQuery);
593    }
594}(function ($) {
595    'use strict';
596
597    var currentlyScrollingTimeDiv = false;
598
599    var default_options = {
600        i18n: {
601            ar: { // Arabic
602                months: [
603					"كانون الثاني", "شباط", "آذار", "نيسان", "مايو", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول"
604                ],
605                dayOfWeekShort: [
606					"ن", "ث", "ع", "خ", "ج", "س", "ح"
607                ],
608                dayOfWeek: ["الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت", "الأحد"]
609            },
610            ro: { // Romanian
611                months: [
612					"Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie"
613                ],
614                dayOfWeekShort: [
615					"Du", "Lu", "Ma", "Mi", "Jo", "Vi", "Sâ"
616                ],
617                dayOfWeek: ["Duminică", "Luni", "Marţi", "Miercuri", "Joi", "Vineri", "Sâmbătă"]
618            },
619            id: { // Indonesian
620                months: [
621					"Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"
622                ],
623                dayOfWeekShort: [
624					"Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"
625                ],
626                dayOfWeek: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"]
627            },
628            is: { // Icelandic
629                months: [
630					"Janúar", "Febrúar", "Mars", "Apríl", "Maí", "Júní", "Júlí", "Ágúst", "September", "Október", "
630Nóvember", "Desember"
631                ],
632                dayOfWeekShort: [
633					"Sun", "Mán", "Þrið", "Mið", "Fim", "Fös", "Lau"
634                ],
635                dayOfWeek: ["Sunnudagur", "Mánudagur", "Þriðjudagur", "Miðvikudagur", "Fimmtudagur", "Föstudagur", "Laugardagur"]
636            },
637            bg: { // Bulgarian
638                months: [
639					"Януари", "Февруари", "Март", "Април", "Май", "Юни", "Юли", "Август", "Септември", "Октомври", "Ноември", "Декември"
640                ],
641                dayOfWeekShort: [
642					"Нд", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"
643                ],
644                dayOfWeek: ["Неделя", "Понеделник", "Вторник", "Сряда", "Четвъртък", "Петък", "Събота"]
645            },
646            fa: { // Persian/Farsi
647                months: [
648					'فروردین', 'اردیبهشت', 'خرداد', 'تیر', 'مرداد', 'شهریور', 'مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسفند'
649                ],
650                dayOfWeekShort: [
651					'یکشنبه', 'دوشنبه', 'سه شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'
652                ],
653                dayOfWeek: ["یک‌شنبه", "دوشنبه", "سه‌شنبه", "چهارشنبه", "پنج‌شنبه", "جمعه", "شنبه", "یک‌شنبه"]
654            },
655            ru: { // Russian
656                months: [
657					'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'
658                ],
659                dayOfWeekShort: [
660					"Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"
661                ],
662                dayOfWeek: ["Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота"]
663            },
664            uk: { // Ukrainian
665                months: [
666					'Січень', 'Лютий', 'Березень', 'Квітень', 'Травень', 'Червень', 'Липень', 'Серпень', 'Вересень', 'Жовтень', 'Листопад', 'Грудень'
667                ],
668                dayOfWeekShort: [
669					"Ндл", "Пнд", "Втр", "Срд", "Чтв", "Птн", "Сбт"
670                ],
671                dayOfWeek: ["Неділя", "Понеділок", "Вівторок", "Середа", "Четвер", "П'ятниця", "Субота"]
672            },
673            en: { // English
674                months: [
675					"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "
675November", "December"
676                ],
677                dayOfWeekShort: [
678					"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
679                ],
680                dayOfWeek: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
681            },
682            el: { // Ελληνικά
683                months: [
684					"Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάιος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"
685                ],
686                dayOfWeekShort: [
687					"Κυρ", "Δευ", "Τρι", "Τετ", "Πεμ", "Παρ", "Σαβ"
688                ],
689                dayOfWeek: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο"]
690            },
691            de: { // German
692                months: [
693					'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'
694                ],
695                dayOfWeekShort: [
696					"So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"
697                ],
698                dayOfWeek: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"]
699            },
700            nl: { // Dutch
701                months: [
702					"januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december"
703                ],
704                dayOfWeekShort: [
705					"zo", "ma", "di", "wo", "do", "vr", "za"
706                ],
707                dayOfWeek: ["zondag", "maandag", "dinsdag", "woensdag", "donderdag", "vrijdag", "zaterdag"]
708            },
709            tr: { // Turkish
710                months: [
711					"Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"
712                ],
713                dayOfWeekShort: [
714					"Paz", "Pts", "Sal", "Çar", "Per", "Cum", "Cts"
715                ],
716                dayOfWeek: ["Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi"]
717            },
718            fr: { //French
719                months: [
720					"Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"
721                ],
722                dayOfWeekShort: [
723					"Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"
724                ],
725                dayOfWeek: ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"]
726            },
727            es: { // Spanish
728                months: [
729					"Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"
730                ],
731                dayOfWeekShort: [
732					"Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb"
733                ],
734                dayOfWeek: ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"]
735            },
736            th: { // Thai
737                months: [
738					'มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม'
739                ],
740                dayOfWeekShort: [
741					'อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'
742                ],
743                dayOfWeek: ["อาทิตย์", "จันทร์", "อังคาร", "พุธ", "พฤหัส", "ศุกร์", "เสาร์", "อาทิตย์"]
744            },
745            pl: { // Polish
746                months: [
747					"styczeń", "luty", "marzec", "kwiecień", "maj", "czerwiec", "lipiec", "sierpień", "wrzesień", "październik", "listopad", "grudzień"
748                ],
749                dayOfWeekShort: [
750					"nd", "pn", "wt", "śr", "cz", "pt", "sb"
751                ],
752                dayOfWeek: ["niedziela", "poniedziałek", "wtorek", "środa", "czwartek", "piątek", "sobota"]
753            },
754            pt: { // Portuguese
755                months: [
756					"Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"
757                ],
758                dayOfWeekShort: [
759					"Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"
760                ],
761                dayOfWeek: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "SÃ
761¡bado"]
762            },
763            ch: { // Simplified Chinese
764                months: [
765					"一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"
766                ],
767                dayOfWeekShort: [
768					"日", "一", "二", "三", "四", "五", "六"
769                ]
770            },
771            se: { // Swedish
772                months: [
773					"Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"
774                ],
775                dayOfWeekShort: [
776					"Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör"
777                ]
778            },
779            kr: { // Korean
780                months: [
781					"1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"
782                ],
783                dayOfWeekShort: [
784					"일", "월", "화", "수", "목", "금", "토"
785                ],
786                dayOfWeek: ["일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일"]
787            },
788            it: { // Italian
789                months: [
790					"Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"
791                ],
792                dayOfWeekShort: [
793					"Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"
794                ],
795                dayOfWeek: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"]
796            },
797            da: { // Dansk
798                months: [
799					"January", "Februar", "Marts", "April", "Maj", "Juni", "July", "August", "September", "Oktober", "November", "December"
800                ],
801                dayOfWeekShort: [
802					"Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"
803                ],
804                dayOfWeek: ["søndag", "mandag", "tirsdag", "onsdag", "torsdag", "fredag", "lørdag"]
805            },
806            no: { // Norwegian
807                months: [
808					"Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"
809                ],
810                dayOfWeekShort: [
811					"Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"
812                ],
813                dayOfWeek: ['Søndag', 'Mandag', 'Tirsdag', 'Onsdag', 'Torsdag', 'Fredag', 'Lørdag']
814            },
815            ja: { // Japanese
816                months: [
817					"1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"
818                ],
819                dayOfWeekShort: [
820					"日", "月", "火", "水", "木", "金", "土"
821                ],
822                dayOfWeek: ["日曜", "月曜", "火曜", "水曜", "木曜", "金曜", "土曜"]
823            },
824            vi: { // Vietnamese
825                months: [
826					"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"
827                ],
828                dayOfWeekShort: [
829					"CN", "T2", "T3", "T4", "T5", "T6", "T7"
830                ],
831                dayOfWeek: ["Chủ nhật", "Thứ hai", "Thứ ba", "Thứ tư", "Thứ năm", "Thứ sáu", "Thứ bảy"]
832            },
833            sl: { // Slovenščina
834                months: [
835					"Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December"
836                ],
837                dayOfWeekShort: [
838					"Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob"
839                ],
840                dayOfWeek: ["Nedelja", "Ponedeljek", "Torek", "Sreda", "Četrtek", "Petek", "Sobota"]
841            },
842            cs: { // Čeština
843                months: [
844					"Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"
845                ],
846                dayOfWeekShort: [
847					"Ne", "Po", "Út", "St", "Čt", "Pá", "So"
848                ]
849            },
850            hu: { // Hungarian
851                months: [
852					"Január", "Február", "Március", "Április", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "
852November", "December"
853                ],
854                dayOfWeekShort: [
855					"Va", "Hé", "Ke", "Sze", "Cs", "Pé", "Szo"
856                ],
857                dayOfWeek: ["vasárnap", "hétfő", "kedd", "szerda", "csütörtök", "péntek", "szombat"]
858            },
859            az: { //Azerbaijanian (Azeri)
860                months: [
861					"Yanvar", "Fevral", "Mart", "Aprel", "May", "Iyun", "Iyul", "Avqust", "Sentyabr", "Oktyabr", "Noyabr", "Dekabr"
862                ],
863                dayOfWeekShort: [
864					"B", "Be", "Ça", "Ç", "Ca", "C", "Ş"
865                ],
866                dayOfWeek: ["Bazar", "Bazar ertəsi", "Çərşənbə axşamı", "Çərşənbə", "Cümə axşamı", "Cümə", "Şənbə"]
867            },
868            bs: { //Bosanski
869                months: [
870					"Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar"
871                ],
872                dayOfWeekShort: [
873					"Ned", "Pon", "Uto", "Sri", "Čet", "Pet", "Sub"
874                ],
875                dayOfWeek: ["Nedjelja", "Ponedjeljak", "Utorak", "Srijeda", "Četvrtak", "Petak", "Subota"]
876            },
877            ca: { //Català
878                months: [
879					"Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"
880                ],
881                dayOfWeekShort: [
882					"Dg", "Dl", "Dt", "Dc", "Dj", "Dv", "Ds"
883                ],
884                dayOfWeek: ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"]
885            },
886            'en-GB': { //English (British)
887                months: [
888					"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "
888November", "December"
889                ],
890                dayOfWeekShort: [
891					"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
892                ],
893                dayOfWeek: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
894            },
895            et: { //"Eesti"
896                months: [
897					"Jaanuar", "Veebruar", "Märts", "Aprill", "Mai", "Juuni", "Juuli", "August", "September", "Oktoober", "November", "Detsember"
898                ],
899                dayOfWeekShort: [
900					"P", "E", "T", "K", "N", "R", "L"
901                ],
902                dayOfWeek: ["Pühapäev", "Esmaspäev", "Teisipäev", "Kolmapäev", "Neljapäev", "Reede", "Laupäev"]
903            },
904            eu: { //Euskara
905                months: [
906					"Urtarrila", "Otsaila", "Martxoa", "Apirila", "Maiatza", "Ekaina", "Uztaila", "Abuztua", "Iraila", "Urria", "Azaroa", "Abendua"
907                ],
908                dayOfWeekShort: [
909					"Ig.", "Al.", "Ar.", "Az.", "Og.", "Or.", "La."
910                ],
911                dayOfWeek: ['Igandea', 'Astelehena', 'Asteartea', 'Asteazkena', 'Osteguna', 'Ostirala', 'Larunbata']
912            },
913            fi: { //Finnish (Suomi)
914                months: [
915					"Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"
916                ],
917                dayOfWeekShort: [
918					"Su", "Ma", "Ti", "Ke", "To", "Pe", "La"
919                ],
920                dayOfWeek: ["sunnuntai", "maanantai", "tiistai", "keskiviikko", "torstai", "perjantai", "lauantai"]
921            },
922            gl: { //Galego
923                months: [
924					"Xan", "Feb", "Maz", "Abr", "Mai", "Xun", "Xul", "Ago", "Set", "Out", "Nov", "Dec"
925                ],
926                dayOfWeekShort: [
927					"Dom", "Lun", "Mar", "Mer", "Xov", "Ven", "Sab"
928                ],
929                dayOfWeek: ["Domingo", "Luns", "Martes", "Mércores", "Xoves", "Venres", "Sábado"]
930            },
931            hr: { //Hrvatski
932                months: [
933					"Siječanj", "Veljača", "Ožujak", "Travanj", "Svibanj", "Lipanj", "Srpanj", "Kolovoz", "Rujan", "Listopad", "Studeni", "Prosinac"
934                ],
935                dayOfWeekShort: [
936					"Ned", "Pon", "Uto", "Sri", "Čet", "Pet", "Sub"
937                ],
938                dayOfWeek: ["Nedjelja", "Ponedjeljak", "Utorak", "Srijeda", "Četvrtak", "Petak", "Subota"]
939            },
940            ko: { //Korean (한국어)
941                months: [
942					"1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"
943                ],
944                dayOfWeekShort: [
945					"일", "월", "화", "수", "목", "금", "토"
946                ],
947                dayOfWeek: ["일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일"]
948            },
949            lt: { //Lithuanian (lietuvių)
950                months: [
951					"Sausio", "Vasario", "Kovo", "Balandžio", "Gegužės", "Birželio", "Liepos", "Rugpjūčio", "Rugsėjo", "Spalio", "Lapkričio", "Gruodžio"
952                ],
953                dayOfWeekShort: [
954					"Sek", "Pir", "Ant", "Tre", "Ket", "Pen", "Šeš"
955                ],
956                dayOfWeek: ["Sekmadienis", "Pirmadienis", "Antradienis", "Trečiadienis", "Ketvirtadienis", "Penktadienis", "Šeštadienis"]
957            },
958            lv: { //Latvian (Latviešu)
959                months: [
960					"Janvāris", "Februāris", "Marts", "Aprīlis ", "Maijs", "Jūnijs", "Jūlijs", "Augusts", "Septembris", "Oktobris", "Novembris", "Decembris"
961                ],
962                dayOfWeekShort: [
963					"Sv", "Pr", "Ot", "Tr", "Ct", "Pk", "St"
964                ],
965                dayOfWeek: ["Svētdiena", "Pirmdiena", "Otrdiena", "Trešdiena", "Ceturtdiena", "Piektdiena", "Sestdiena"]
966            },
967            mk: { //Macedonian (Македонски)
968                months: [
969					"јануари", "февруари", "март", "април", "мај", "јуни", "јули", "август", "септември", "октомври", "ноември", "декември"
970                ],
971                dayOfWeekShort: [
972					"нед", "пон", "вто", "сре", "чет", "пет", "саб"
973                ],
974                dayOfWeek: ["Недела", "Понеделник", "Вторник", "Среда", "Четврток", "Петок", "Сабота"]
975            },
976            mn: { //Mongolian (Монгол)
977                months: [
978					"1-р сар", "2-р сар", "3-р сар", "4-р сар", "5-р сар", "6-р сар", "7-р сар", "8-р сар", "9-р сар", "10-р сар", "11-р сар", "12-р сар"
979                ],
980                dayOfWeekShort: [
981					"Дав", "Мяг", "Лха", "Пүр", "Бсн", "Бям", "Ням"
982                ],
983                dayOfWeek: ["Даваа", "Мягмар", "Лхагва", "Пүрэв", "Баасан", "Бямба", "Ням"]
984            },
985            'pt-BR': { //Português(Brasil)
986                months: [
987					"Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"
988                ],
989                dayOfWeekShort: [
990					"Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb"
991                ],
992                dayOfWeek: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "SÃ
992¡bado"]
993            },
994            sk: { //Slovenčina
995                months: [
996					"Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"
997                ],
998                dayOfWeekShort: [
999					"Ne", "Po", "Ut", "St", "Å t", "Pi", "So"
1000                ],
1001                dayOfWeek: ["Nedeľa", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatok", "Sobota"]
1002            },
1003            sq: { //Albanian (Shqip)
1004                months: [
1005					"Janar", "Shkurt", "Mars", "Prill", "Maj", "Qershor", "Korrik", "Gusht", "Shtator", "Tetor", "Nëntor", "Dhjetor"
1006                ],
1007                dayOfWeekShort: [
1008					"Die", "Hën", "Mar", "Mër", "Enj", "Pre", "Shtu"
1009                ],
1010                dayOfWeek: ["E Diel", "E Hënë", "E Martē", "E Mërkurë", "E Enjte", "E Premte", "E Shtunë"]
1011            },
1012            'sr-YU': { //Serbian (Srpski)
1013                months: [
1014					"Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar"
1015                ],
1016                dayOfWeekShort: [
1017					"Ned", "Pon", "Uto", "Sre", "čet", "Pet", "Sub"
1018                ],
1019                dayOfWeek: ["Nedelja", "Ponedeljak", "Utorak", "Sreda", "Četvrtak", "Petak", "Subota"]
1020            },
1021            sr: { //Serbian Cyrillic (Српски)
1022                months: [
1023					"јануар", "фебруар", "март", "април", "мај", "јун", "јул", "август", "септембар", "октобар", "новембар", "децембар"
1024                ],
1025                dayOfWeekShort: [
1026					"нед", "пон", "уто", "сре", "чет", "пет", "суб"
1027                ],
1028                dayOfWeek: ["Недеља", "Понедељак", "Уторак", "Среда", "Четвртак", "Петак", "Субота"]
1029            },
1030            sv: { //Svenska
1031                months: [
1032					"Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"
1033                ],
1034                dayOfWeekShort: [
1035					"Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör"
1036                ],
1037                dayOfWeek: ["Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"]
1038            },
1039            'zh-TW': { //Traditional Chinese (繁體中文)
1040                months: [
1041					"一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"
1042                ],
1043                dayOfWeekShort: [
1044					"日", "一", "二", "三", "四", "五", "六"
1045                ],
1046                dayOfWeek: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"]
1047            },
1048            zh: { //Simplified Chinese (简体中文)
1049                months: [
1050					"一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"
1051                ],
1052                dayOfWeekShort: [
1053					"日", "一", "二", "三", "四", "五", "六"
1054                ],
1055                dayOfWeek: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"]
1056            },
1057            he: { //Hebrew (עברית)
1058                months: [
1059					'ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר'
1060                ],
1061                dayOfWeekShort: [
1062					'א\'', 'ב\'', 'ג\'', 'ד\'', 'ה\'', 'ו\'', 'שבת'
1063                ],
1064                dayOfWeek: ["ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת", "ראשון"]
1065            },
1066            hy: { // Armenian
1067                months: [
1068					"Հունվար", "Փետրվար", "Մարտ", "Ապրիլ", "Մայիս", "Հունիս", "Հուլիս", "Օգոստոս", "Սեպտեմբեր", "Հոկտեմբեր", "Նոյեմբեր", "Դեկտեմբեր"
1069                ],
1070                dayOfWeekShort: [
1071					"Կի", "Երկ", "Երք", "Չոր", "Հնգ", "Ուրբ", "Շբթ"
1072                ],
1073                dayOfWeek: ["Կիրակի", "Երկուշաբթի", "Երեքշաբթի", "Չորեքշաբթի", "Հինգշաբթի", "Ուրբաթ", "Շաբաթ"]
1074            },
1075            kg: { // Kyrgyz
1076                months: [
vendor: 12,936 bytes, lines 1077-1426
1077					'Үчтүн айы', 'Бирдин айы', 'Жалган Куран', 'Чын Куран', 'Бугу', 'Кулжа', 'Теке', 'Баш Оона', 'Аяк Оона', 'Тогуздун айы', 'Жетинин айы', 'Бештин айы'
1078                ],
1079                dayOfWeekShort: [
1080					"Жек", "Дүй", "Шей", "Шар", "Бей", "Жум", "Ише"
1081                ],
1082                dayOfWeek: [
1083					"Жекшемб", "Дүйшөмб", "Шейшемб", "Шаршемб", "Бейшемби", "Жума", "Ишенб"
1084                ]
1085            },
1086            rm: { // Romansh
1087                months: [
1088					"Schaner", "Favrer", "Mars", "Avrigl", "Matg", "Zercladur", "Fanadur", "Avust", "Settember", "October", "November", "December"
1089                ],
1090                dayOfWeekShort: [
1091					"Du", "Gli", "Ma", "Me", "Gie", "Ve", "So"
1092                ],
1093                dayOfWeek: [
1094					"Dumengia", "Glindesdi", "Mardi", "Mesemna", "Gievgia", "Venderdi", "Sonda"
1095                ]
1096            },
1097            ka: { // Georgian
1098                months: [
1099					'იანვარი', 'თებერვალი', 'მარტი', 'აპრილი', 'მაისი', 'ივნისი', 'ივლისი', 'აგვისტო', 'სექტემბერი', 'ოქტომბერი', 'ნოემბერი', 'დეკემბერი'
1100                ],
1101                dayOfWeekShort: [
1102					"კვ", "ორშ", "სამშ", "ოთხ", "ხუთ", "პარ", "შაბ"
1103                ],
1104                dayOfWeek: ["კვირა", "ორშაბათი", "სამშაბათი", "ოთხშაბათი", "ხუთშაბათი", "პარასკევი", "შაბათი"]
1105            },
1106        },
1107        value: '',
1108        rtl: false,
1109
1110        format: 'Y/m/d H:i',
1111        formatTime: 'H:i',
1112        formatDate: 'Y/m/d',
1113
1114        startDate: false, // new Date(), '1986/12/08', '-1970/01/05','-1970/01/05',
1115        step: 60,
1116        monthChangeSpinner: true,
1117
1118        closeOnDateSelect: false,
1119        closeOnTimeSelect: true,
1120        closeOnWithoutClick: true,
1121        closeOnInputClick: true,
1122
1123        timepicker: true,
1124        datepicker: true,
1125        weeks: false,
1126
1127        defaultTime: false,	// use formatTime format (ex. '10:00' for formatTime:	'H:i')
1128        defaultDate: false,	// use formatDate format (ex new Date() or '1986/12/08' or '-1970/01/05' or '-1970/01/05')
1129
1130        minDate: false,
1131        maxDate: false,
1132        minTime: false,
1133        maxTime: false,
1134        disabledMinTime: false,
1135        disabledMaxTime: false,
1136
1137        allowTimes: [],
1138        opened: false,
1139        initTime: true,
1140        inline: false,
1141        theme: '',
1142
1143        onSelectDate: function () { },
1144        onSelectTime: function () { },
1145        onChangeMonth: function () { },
1146        onGetWeekOfYear: function () { },
1147        onChangeYear: function () { },
1148        onChangeDateTime: function () { },
1149        onShow: function () { },
1150        onClose: function () { },
1151        onGenerate: function () { },
1152
1153        withoutCopyright: true,
1154        inverseButton: false,
1155        hours12: false,
1156        next: 'xdsoft_next',
1157        prev: 'xdsoft_prev',
1158        dayOfWeekStart: 0,
1159        parentID: 'body',
1160        timeHeightInTimePicker: 25,
1161        timepickerScrollbar: true,
1162        todayButton: true,
1163        prevButton: true,
1164        nextButton: true,
1165        defaultSelect: true,
1166
1167        scrollMonth: true,
1168        scrollTime: true,
1169        scrollInput: true,
1170
1171        lazyInit: false,
1172        mask: false,
1173        validateOnBlur: true,
1174        allowBlank: true,
1175        yearStart: 1950,
1176        yearEnd: 2050,
1177        monthStart: 0,
1178        monthEnd: 11,
1179        style: '',
1180        id: '',
1181        fixed: false,
1182        roundTime: 'ceil', // ceil, floor	/* OFC update - to ceil */
1183        className: '',
1184        weekends: [],
1185        highlightedDates: [],
1186        highlightedPeriods: [],
1187        allowDates: [],
1188        allowDateRe: null,
1189        disabledDates: [],
1190        disabledWeekDays: [],
1191        yearOffset: 0,
1192        beforeShowDay: null,
1193
1194        enterLikeTab: true,
1195        showApplyButton: false
1196    };
1197
1198    var dateHelper = null,
1199		globalLocaleDefault = 'en',
1200		globalLocale = 'en';
1201
1202    var dateFormatterOptionsDefault = {
1203        meridiem: ['AM', 'PM']
1204    };
1205
1206    var initDateFormatter = function () {
1207        var locale = default_options.i18n[globalLocale],
1208			opts = {
1209			    days: locale.dayOfWeek,
1210			    daysShort: locale.dayOfWeekShort,
1211			    months: locale.months,
1212			    monthsShort: $.map(locale.months, function (n) { return n.substring(0, 3) }),
1213			};
1214
1215        dateHelper = new DateFormatter({
1216            dateSettings: $.extend({}, dateFormatterOptionsDefault, opts)
1217        });
1218    };
1219
1220    // for locale settings
1221    $.datetimepicker = {
1222        setLocale: function (locale) {
1223            var newLocale = default_options.i18n[locale] ? locale : globalLocaleDefault;
1224            if (globalLocale != newLocale) {
1225                globalLocale = newLocale;
1226                // reinit date formatter
1227                initDateFormatter();
1228            }
1229        },
1230        setDateFormatter: function (dateFormatter) {
1231            dateHelper = dateFormatter;
1232        },
1233        RFC_2822: 'D, d M Y H:i:s O',
1234        ATOM: 'Y-m-d\TH:i:sP',
1235        ISO_8601: 'Y-m-d\TH:i:sO',
1236        RFC_822: 'D, d M y H:i:s O',
1237        RFC_850: 'l, d-M-y H:i:s T',
1238        RFC_1036: 'D, d M y H:i:s O',
1239        RFC_1123: 'D, d M Y H:i:s O',
1240        RSS: 'D, d M Y H:i:s O',
1241        W3C: 'Y-m-d\TH:i:sP'
1242    };
1243
1244    // first init date formatter
1245    initDateFormatter();
1246
1247    // fix for ie8
1248    if (!window.getComputedStyle) {
1249        window.getComputedStyle = function (el, pseudo) {
1250            this.el = el;
1251            this.getPropertyValue = function (prop) {
1252                var re = /(\-([a-z]){1})/g;
1253                if (prop === 'float') {
1254                    prop = 'styleFloat';
1255                }
1256                if (re.test(prop)) {
1257                    prop = prop.replace(re, function (a, b, c) {
1258                        return c.toUpperCase();
1259                    });
1260                }
1261                return el.currentStyle[prop] || null;
1262            };
1263            return this;
1264        };
1265    }
1266    if (!Array.prototype.indexOf) {
1267        Array.prototype.indexOf = function (obj, start) {
1268            var i, j;
1269            for (i = (start || 0), j = this.length; i < j; i += 1) {
1270                if (this[i] === obj) { return i; }
1271            }
1272            return -1;
1273        };
1274    }
1275    Date.prototype.countDaysInMonth = function () {
1276        return new Date(this.getFullYear(), this.getMonth() + 1, 0).getDate();
1277    };
1278    $.fn.xdsoftScroller = function (percent) {
1279        return this.each(function () {
1280            var timeboxparent = $(this),
1281				pointerEventToXY = function (e) {
1282				    var out = { x: 0, y: 0 },
1283						touch;
1284				    if (e.type === 'touchstart' || e.type === 'touchmove' || e.type === 'touchend' || e.type === 'touchcancel') {
1285				        touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
1286				        out.x = touch.clientX;
1287				        out.y = touch.clientY;
1288				    } else if (e.type === 'mousedown' || e.type === 'mouseup' || e.type === 'mousemove' || e.type === 'mouseover' || e.type === 'mouseout' || e.type === 'mouseenter' || e.type === 'mouseleave') {
1289				        out.x = e.clientX;
1290				        out.y = e.clientY;
1291				    }
1292				    return out;
1293				},
1294				timebox,
1295				parentHeight,
1296				height,
1297				scrollbar,
1298				scroller,
1299				maximumOffset = 100,
1300				start = false,
1301				startY = 0,
1302				startTop = 0,
1303				h1 = 0,
1304				touchStart = false,
1305				startTopScroll = 0,
1306				calcOffset = function () { };
1307            if (percent === 'hide') {
1308                timeboxparent.find('.xdsoft_scrollbar').hide();
1309                return;
1310            }
1311            if (!$(this).hasClass('xdsoft_scroller_box')) {
1312                timebox = timeboxparent.children().eq(0);
1313                parentHeight = timeboxparent[0].clientHeight;
1314                height = timebox[0].offsetHeight;
1315                scrollbar = $('<div class="xdsoft_scrollbar"></div>');
1316                scroller = $('<div class="xdsoft_scroller"></div>');
1317                scrollbar.append(scroller);
1318
1319                timeboxparent.addClass('xdsoft_scroller_box').append(scrollbar);
1320                calcOffset = function calcOffset(event) {
1321                    var offset = pointerEventToXY(event).y - startY + startTopScroll;
1322                    if (offset < 0) {
1323                        offset = 0;
1324                    }
1325                    if (offset + scroller[0].offsetHeight > h1) {
1326                        offset = h1 - scroller[0].offsetHeight;
1327                    }
1328                    timeboxparent.trigger('scroll_element.xdsoft_scroller', [maximumOffset ? offset / maximumOffset : 0]);
1329                };
1330
1331                scroller
1332					.on('touchstart.xdsoft_scroller mousedown.xdsoft_scroller', function (event) {
1333					    if (!parentHeight) {
1334					        timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percent]);
1335					    }
1336
1337					    startY = pointerEventToXY(event).y;
1338					    startTopScroll = parseInt(scroller.css('margin-top'), 10);
1339					    h1 = scrollbar[0].offsetHeight;
1340
1341					    if (event.type === 'mousedown' || event.type === 'touchstart') {
1342					        if (document) {
1343					            $(document.body).addClass('xdsoft_noselect');
1344					        }
1345					        $([document.body, window]).on('touchend mouseup.xdsoft_scroller', function arguments_callee() {
1346					            $([document.body, window]).off('touchend mouseup.xdsoft_scroller', arguments_callee)
1347									.off('mousemove.xdsoft_scroller', calcOffset)
1348									.removeClass('xdsoft_noselect');
1349					        });
1350					        $(document.body).on('mousemove.xdsoft_scroller', calcOffset);
1351					    } else {
1352					        touchStart = true;
1353					        event.stopPropagation();
1354					        event.preventDefault();
1355					    }
1356					})
1357					.on('touchmove', function (event) {
1358					    if (touchStart) {
1359					        event.preventDefault();
1360					        calcOffset(event);
1361					    }
1362					})
1363					.on('touchend touchcancel', function () {
1364					    touchStart = false;
1365					    startTopScroll = 0;
1366					});
1367
1368                timeboxparent
1369					.on('scroll_element.xdsoft_scroller', function (event, percentage) {
1370					    if (!parentHeight) {
1371					        timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percentage, true]);
1372					    }
1373					    percentage = percentage > 1 ? 1 : (percentage < 0 || isNaN(percentage)) ? 0 : percentage;
1374
1375					    scroller.css('margin-top', maximumOffset * percentage);
1376
1377					    setTimeout(function () {
1378					        timebox.css('marginTop', -parseInt((timebox[0].offsetHeight - parentHeight) * percentage, 10));
1379					    }, 10);
1380					})
1381					.on('resize_scroll.xdsoft_scroller', function (event, percentage, noTriggerScroll) {
1382					    var percent, sh;
1383					    parentHeight = timeboxparent[0].clientHeight;
1384					    height = timebox[0].offsetHeight;
1385					    percent = parentHeight / height;
1386					    sh = percent * scrollbar[0].offsetHeight;
1387					    if (percent > 1) {
1388					        scroller.hide();
1389					    } else {
1390					        scroller.show();
1391					        scroller.css('height', parseInt(sh > 10 ? sh : 10, 10));
1392					        maximumOffset = scrollbar[0].offsetHeight - scroller[0].offsetHeight;
1393					        if (noTriggerScroll !== true) {
1394					            timeboxparent.trigger('scroll_element.xdsoft_scroller', [percentage || Math.abs(parseInt(timebox.css('marginTop'), 10)) / (height - parentHeight)]);
1395					        }
1396					    }
1397					});
1398
1399                timeboxparent.on('mousewheel', function (event) {
1400                    var top = Math.abs(parseInt(timebox.css('marginTop'), 10));
1401
1402                    top = top - (event.deltaY * 20);
1403                    if (top < 0) {
1404                        top = 0;
1405                    }
1406
1407                    timeboxparent.trigger('scroll_element.xdsoft_scroller', [top / (height - parentHeight)]);
1408                    event.stopPropagation();
1409                    return false;
1410                });
1411
1412                timeboxparent.on('touchstart', function (event) {
1413                    start = pointerEventToXY(event);
1414                    startTop = Math.abs(parseInt(timebox.css('marginTop'), 10));
1415                });
1416
1417                timeboxparent.on('touchmove', function (event) {
1418                    if (start) {
1419                        event.preventDefault();
1420                        var coord = pointerEventToXY(event);
1421                        timeboxparent.trigger('scroll_element.xdsoft_scroller', [(startTop - (coord.y - start.y)) / (height - parentHeight)]);
1422                    }
1423                });
1424
1425                timeboxparent.on('touchend touchcancel', function () {
1426                    start = false;
1427                    startTop = 0;
1428                });
1429            }
1430            timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percent]);
1431        });
1432    };
1433
1434    $.fn.datetimepicker = function (opt, opt2) {
1435        var result = this,
1436			KEY0 = 48,
1437			KEY9 = 57,
1438			_KEY0 = 96,
1439			_KEY9 = 105,
1440			CTRLKEY = 17,
1441			DEL = 46,
1442			ENTER = 13,
1443			ESC = 27,
1444			BACKSPACE = 8,
1445			ARROWLEFT = 37,
1446			ARROWUP = 38,
1447			ARROWRIGHT = 39,
1448			ARROWDOWN = 40,
1449			TAB = 9,
1450			F5 = 116,
1451			AKEY = 65,
1452			CKEY = 67,
1453			VKEY = 86,
1454			ZKEY = 90,
1455			YKEY = 89,
1456			ctrlDown = false,
1457			options = ($.isPlainObject(opt) || !opt) ? $.extend(true, {}, default_options, opt) : $.extend(true, {}, default_options),
1458
1459			lazyInitTimer = 0,
1460			createDateTimePicker,
1461			destroyDateTimePicker,
1462
1463			lazyInit = function (input) {
1464			    input
1465					.on('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', function initOnActionCallback() {
1466					    if (input.is(':disabled') || input.data('xdsoft_datetimepicker')) {
1467					        return;
1468					    }
1469					    clearTimeout(lazyInitTimer);
1470					    lazyInitTimer = setTimeout(function () {
1471
1472					        if (!input.data('xdsoft_datetimepicker')) {
1473					            createDateTimePicker(input);
1474					        }
1475					        input
1476								.off('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', initOnActionCallback)
1477								.trigger('open.xdsoft');
1478					    }, 100);
1479					});
1480			};
1481
1482        /*
1483		createDateTimePicker = function (input) {
1484			var datetimepicker = $('<div class="xdsoft_datetimepicker xdsoft_noselect"></div>'),
1485				xdsoft_copyright = $('<div class="xdsoft_copyright"><a target="_blank" href="http://xdsoft.net/jqplugins/datetimepicker/">xdsoft.net</a></div>'),
1486				datepicker = $('<div class="xdsoft_datepicker active"></div>'),
1487				month_picker = $('<div class="xdsoft_monthpicker"><button type="button" class="xdsoft_prev"></button><button type="button" class="xdsoft_today_button"></button>' +
1488					'<div class="xdsoft_label xdsoft_month"><span></span><i></i></div>' +
1489					'<div class="xdsoft_label xdsoft_year"><span></span><i></i></div>' +
1490					'<button type="button" class="xdsoft_next"></button></div>'),
1491				calendar = $('<div class="xdsoft_calendar"></div>'),
1492				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>'),
1493				timeboxparent = timepicker.find('.xdsoft_time_box').eq(0),
1494				timebox = $('<div class="xdsoft_time_variant"></div>'),
1495				applyButton = $('<button type="button" class="xdsoft_save_selected blue-gradient-button">Save Selected</button>'),
1496
1497				monthselect = $('<div class="xdsoft_select xdsoft_monthselect"><div></div></div>'),
1498				//monthselect = '',
1499				yearselect = $('<div class="xdsoft_select xdsoft_yearselect"><div></div></div>'),
1500				//yearselect = '',
1501				triggerAfterOpen = false,
1502				XDSoft_datetime,
1503
1504				xchangeTimer,
1505				timerclick,
1506				current_time_index,
1507				setPos,
1508				timer = 0,
1509				_xdsoft_datetime,
1510				forEachAncestorOf,
1511				throttle;
1512				
1513			*/
1514
1515        /* OFC UPDATE ************ */
1516        createDateTimePicker = function (input) {
1517            var timeTitle = 'Check-In Time';
1518            var dateTitle = 'Select a Date';
1519            if (options.className == 'depart') {
1520                timeTitle = 'Check-In Time';
1521                dateTitle = 'Select Check-In Date';
1522            }
1523            if (options.className == 'arrive') {
1524                timeTitle = 'Check-Out Time';
1525                dateTitle = 'Select Check-Out Date';
1526            }
1527            if (options.className == 'timeOnly') {
1528                timeTitle = 'Entrance Time';
1529            }
1530            var datetimepicker = $('<div class="xdsoft_datetimepicker xdsoft_noselect"></div>'),
1531                xdsoft_copyright = $('<div class="xdsoft_copyright"><a target="_blank" href="http://xdsoft.net/jqplugins/datetimepicker/">xdsoft.net</a></div>'),
1532                datepicker = $('<div class="xdsoft_datepicker active"></div>'),
1533                month_picker = $('<div class="xdsoft_monthpicker"><button type="button" class="xdsoft_prev"></button><button type="button" class="xdsoft_today_button"></button>' +
1534                    '<div class="xdsoft_label xdsoft_month"><i class="icon-calendar"></i><span></span></div>' +
1535                    '<div class="xdsoft_label xdsoft_year"><span></span></div>' +
1536                    '<button type="button" class="xdsoft_next"></button></div>'),
1537                calendar = $('<div class="xdsoft_calendar"></div>'),
vendor: 50,788 bytes, lines 1538-2721
1538                timepicker = $('<div class="xdsoft_timepicker active"><div class="time-top"><p class="light"><span class="icon-time"></span>' + timeTitle + '</p><button type="button" class="xdsoft_prev"></button></div><div class="xdsoft_time_box"></div><button type="button" class="xdsoft_next"></button></div><div class="clearfix"></div>'),
1539                timeboxparent = timepicker.find('.xdsoft_time_box').eq(0),
1540                timebox = $('<div class="xdsoft_time_variant"></div>'),
1541                applyButton = $('<button type="button" class="xdsoft_save_selected blue-gradient-button">Save Selected</button>'),
1542
1543                monthselect = $('<div class="xdsoft_select xdsoft_monthselect"><div></div></div>'),
1544                yearselect = $('<div class="xdsoft_select xdsoft_yearselect"><div></div></div>'),
1545                triggerAfterOpen = false,
1546                XDSoft_datetime,
1547
1548                xchangeTimer,
1549                timerclick,
1550                current_time_index,
1551                setPos,
1552                timer = 0,
1553                _xdsoft_datetime,
1554                forEachAncestorOf,
1555                throttle;
1556
1557            if (options.id) {
1558                datetimepicker.attr('id', options.id);
1559            }
1560            if (options.style) {
1561                datetimepicker.attr('style', options.style);
1562            }
1563            if (options.weeks) {
1564                datetimepicker.addClass('xdsoft_showweeks');
1565            }
1566            if (options.rtl) {
1567                datetimepicker.addClass('xdsoft_rtl');
1568            }
1569
1570            datetimepicker.addClass('xdsoft_' + options.theme);
1571            datetimepicker.addClass(options.className);
1572
1573            month_picker
1574				.find('.xdsoft_month span')
1575					.after(monthselect);
1576            month_picker
1577				.find('.xdsoft_year span')
1578					.after(yearselect);
1579
1580            month_picker
1581				.find('.xdsoft_month,.xdsoft_year')
1582					.on('touchstart mousedown.xdsoft', function (event) {
1583					    var select = $(this).find('.xdsoft_select').eq(0),
1584                            val = 0,
1585                            top = 0,
1586                            visible = select.is(':visible'),
1587                            items,
1588                            i;
1589
1590					    month_picker
1591                            .find('.xdsoft_select')
1592                                .hide();
1593					    if (_xdsoft_datetime.currentTime) {
1594					        val = _xdsoft_datetime.currentTime[$(this).hasClass('xdsoft_month') ? 'getMonth' : 'getFullYear']();
1595					    }
1596
1597					    select[visible ? 'hide' : 'show']();
1598					    for (items = select.find('div.xdsoft_option'), i = 0; i < items.length; i += 1) {
1599					        if (items.eq(i).data('value') === val) {
1600					            break;
1601					        } else {
1602					            top += items[0].offsetHeight;
1603					        }
1604					    }
1605
1606					    select.xdsoftScroller(top / (select.children()[0].offsetHeight - (select[0].clientHeight)));
1607					    event.stopPropagation();
1608					    return false;
1609					});
1610
1611            month_picker
1612				.find('.xdsoft_select')
1613					.xdsoftScroller()
1614				.on('touchstart mousedown.xdsoft', function (event) {
1615				    event.stopPropagation();
1616				    event.preventDefault();
1617				})
1618				.on('touchstart mousedown.xdsoft', '.xdsoft_option', function () {
1619				    if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null) {
1620				        _xdsoft_datetime.currentTime = _xdsoft_datetime.now();
1621				    }
1622
1623				    var year = _xdsoft_datetime.currentTime.getFullYear();
1624				    if (_xdsoft_datetime && _xdsoft_datetime.currentTime) {
1625				        _xdsoft_datetime.currentTime[$(this).parent().parent().hasClass('xdsoft_monthselect') ? 'setMonth' : 'setFullYear']($(this).data('value'));
1626				    }
1627
1628				    $(this).parent().parent().hide();
1629
1630				    datetimepicker.trigger('xchange.xdsoft');
1631				    if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) {
1632				        options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
1633				    }
1634
1635				    if (year !== _xdsoft_datetime.currentTime.getFullYear() && $.isFunction(options.onChangeYear)) {
1636				        options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
1637				    }
1638				});
1639
1640            datetimepicker.getValue = function () {
1641                return _xdsoft_datetime.getCurrentTime();
1642            };
1643
1644            datetimepicker.setOptions = function (_options) {
1645                var highlightedDates = {};
1646
1647                options = $.extend(true, {}, options, _options);
1648
1649                if (_options.allowTimes && $.isArray(_options.allowTimes) && _options.allowTimes.length) {
1650                    options.allowTimes = $.extend(true, [], _options.allowTimes);
1651                }
1652
1653                if (_options.weekends && $.isArray(_options.weekends) && _options.weekends.length) {
1654                    options.weekends = $.extend(true, [], _options.weekends);
1655                }
1656
1657                if (_options.allowDates && $.isArray(_options.allowDates) && _options.allowDates.length) {
1658                    options.allowDates = $.extend(true, [], _options.allowDates);
1659                }
1660
1661                if (_options.allowDateRe && Object.prototype.toString.call(_options.allowDateRe) === "[object String]") {
1662                    options.allowDateRe = new RegExp(_options.allowDateRe);
1663                }
1664
1665                if (_options.highlightedDates && $.isArray(_options.highlightedDates) && _options.highlightedDates.length) {
1666                    $.each(_options.highlightedDates, function (index, value) {
1667                        var splitData = $.map(value.split(','), $.trim),
1668							exDesc,
1669							hDate = new HighlightedDate(dateHelper.parseDate(splitData[0], options.formatDate), splitData[1], splitData[2]), // date, desc, style
1670							keyDate = dateHelper.formatDate(hDate.date, options.formatDate);
1671                        if (highlightedDates[keyDate] !== undefined) {
1672                            exDesc = highlightedDates[keyDate].desc;
1673                            if (exDesc && exDesc.length && hDate.desc && hDate.desc.length) {
1674                                highlightedDates[keyDate].desc = exDesc + "\n" + hDate.desc;
1675                            }
1676                        } else {
1677                            highlightedDates[keyDate] = hDate;
1678                        }
1679                    });
1680
1681                    options.highlightedDates = $.extend(true, [], highlightedDates);
1682                }
1683
1684                if (_options.highlightedPeriods && $.isArray(_options.highlightedPeriods) && _options.highlightedPeriods.length) {
1685                    //highlightedDates = $.extend(true, [], options.highlightedDates);
1686                    $.each(_options.highlightedPeriods, function (index, value) {
1687                        var dateTest, // start date
1688							dateEnd,
1689							desc,
1690							hDate,
1691							keyDate,
1692							exDesc,
1693							style;
1694                        if ($.isArray(value)) {
1695                            dateTest = value[0];
1696                            dateEnd = value[1];
1697                            desc = value[2];
1698                            style = value[3];
1699                        }
1700                        else {
1701                            var splitData = $.map(value.split(','), $.trim);
1702                            dateTest = dateHelper.parseDate(splitData[0], options.formatDate);
1703                            dateEnd = dateHelper.parseDate(splitData[1], options.formatDate);
1704                            desc = splitData[2];
1705                            style = splitData[3];
1706                        }
1707                        if (dateTest) {
1708
1709
1710                            while (dateTest <= dateEnd) {
1711                                hDate = new HighlightedDate(dateTest, desc, style);
1712                                keyDate = dateHelper.formatDate(dateTest, options.formatDate);
1713                                dateTest.setDate(dateTest.getDate() + 1);
1714                                if (highlightedDates[keyDate] !== undefined) {
1715                                    exDesc = highlightedDates[keyDate].desc;
1716                                    if (exDesc && exDesc.length && hDate.desc && hDate.desc.length) {
1717                                        highlightedDates[keyDate].desc = exDesc + "\n" + hDate.desc;
1718                                    }
1719                                } else {
1720                                    highlightedDates[keyDate] = hDate;
1721                                }
1722                            }
1723
1724                        }
1725                    });
1726
1727                    options.highlightedDates = $.extend(true, [], highlightedDates);
1728                }
1729
1730                if (_options.disabledDates && $.isArray(_options.disabledDates) && _options.disabledDates.length) {
1731                    options.disabledDates = $.extend(true, [], _options.disabledDates);
1732                }
1733
1734                if (_options.disabledWeekDays && $.isArray(_options.disabledWeekDays) && _options.disabledWeekDays.length) {
1735                    options.disabledWeekDays = $.extend(true, [], _options.disabledWeekDays);
1736                }
1737
1738                if ((options.open || options.opened) && (!options.inline)) {
1739                    input.trigger('open.xdsoft');
1740                }
1741
1742                if (options.inline) {
1743                    triggerAfterOpen = true;
1744                    datetimepicker.addClass('xdsoft_inline');
1745                    input.after(datetimepicker).hide();
1746                }
1747
1748                if (options.inverseButton) {
1749                    options.next = 'xdsoft_prev';
1750                    options.prev = 'xdsoft_next';
1751                }
1752
1753                if (options.datepicker) {
1754                    datepicker.addClass('active');
1755                } else {
1756                    datepicker.removeClass('active');
1757                }
1758
1759                if (options.timepicker) {
1760                    timepicker.addClass('active');
1761                } else {
1762                    timepicker.removeClass('active');
1763                }
1764
1765                if (options.value) {
1766                    _xdsoft_datetime.setCurrentTime(options.value);
1767                    if (input && input.val) {
1768                        input.val(_xdsoft_datetime.str);
1769                    }
1770                }
1771
1772                if (isNaN(options.dayOfWeekStart)) {
1773                    options.dayOfWeekStart = 0;
1774                } else {
1775                    options.dayOfWeekStart = parseInt(options.dayOfWeekStart, 10) % 7;
1776                }
1777
1778                if (!options.timepickerScrollbar) {
1779                    timeboxparent.xdsoftScroller('hide');
1780                }
1781
1782                if (options.minDate && /^[\+\-](.*)$/.test(options.minDate)) {
1783                    options.minDate = dateHelper.formatDate(_xdsoft_datetime.strToDateTime(options.minDate), options.formatDate);
1784                }
1785
1786                if (options.maxDate && /^[\+\-](.*)$/.test(options.maxDate)) {
1787                    options.maxDate = dateHelper.formatDate(_xdsoft_datetime.strToDateTime(options.maxDate), options.formatDate);
1788                }
1789
1790                applyButton.toggle(options.showApplyButton);
1791
1792                month_picker
1793					.find('.xdsoft_today_button')
1794						.css('visibility', !options.todayButton ? 'hidden' : 'visible');
1795
1796                month_picker
1797					.find('.' + options.prev)
1798						.css('visibility', !options.prevButton ? 'hidden' : 'visible');
1799
1800                month_picker
1801					.find('.' + options.next)
1802						.css('visibility', !options.nextButton ? 'hidden' : 'visible');
1803
1804                setMask(options);
1805
1806                if (options.validateOnBlur) {
1807                    input
1808						.off('blur.xdsoft')
1809						.on('blur.xdsoft', function () {
1810						    if (options.allowBlank && (!$.trim($(this).val()).length || (typeof options.mask == "string" && $.trim($(this).val()) === options.mask.replace(/[0-9]/g, '_')))) {
1811						        $(this).val(null);
1812						        datetimepicker.data('xdsoft_datetime').empty();
1813						    } else {
1814						        var d = dateHelper.parseDate($(this).val(), options.format);
1815						        if (d) { // parseDate() may skip some invalid parts like date or time, so make it clear for user: show parsed date/time
1816						            $(this).val(dateHelper.formatDate(d, options.format));
1817						        } else {
1818						            var splittedHours = +([$(this).val()[0], $(this).val()[1]].join('')),
1819										splittedMinutes = +([$(this).val()[2], $(this).val()[3]].join(''));
1820
1821						            // parse the numbers as 0312 => 03:12
1822						            if (!options.datepicker && options.timepicker && splittedHours >= 0 && splittedHours < 24 && splittedMinutes >= 0 && splittedMinutes < 60) {
1823						                $(this).val([splittedHours, splittedMinutes].map(function (item) {
1824						                    return item > 9 ? item : '0' + item;
1825						                }).join(':'));
1826						            } else {
1827						                $(this).val(dateHelper.formatDate(_xdsoft_datetime.now(), options.format));
1828						            }
1829						        }
1830						        datetimepicker.data('xdsoft_datetime').setCurrentTime($(this).val());
1831						    }
1832
1833						    datetimepicker.trigger('changedatetime.xdsoft');
1834						    datetimepicker.trigger('close.xdsoft');
1835						});
1836                }
1837                options.dayOfWeekStartPrev = (options.dayOfWeekStart === 0) ? 6 : options.dayOfWeekStart - 1;
1838
1839                datetimepicker
1840					.trigger('xchange.xdsoft')
1841					.trigger('afterOpen.xdsoft');
1842            };
1843
1844            datetimepicker
1845				.data('options', options)
1846				.on('touchstart mousedown.xdsoft', function (event) {
1847				    event.stopPropagation();
1848				    event.preventDefault();
1849				    yearselect.hide();
1850				    monthselect.hide();
1851				    return false;
1852				});
1853
1854            //scroll_element = timepicker.find('.xdsoft_time_box');
1855            timeboxparent.append(timebox);
1856            timeboxparent.xdsoftScroller();
1857
1858            datetimepicker.on('afterOpen.xdsoft', function () {
1859                timeboxparent.xdsoftScroller();
1860            });
1861
1862            datetimepicker
1863				.append(datepicker)
1864				.append(timepicker);
1865
1866            if (options.withoutCopyright !== true) {
1867                datetimepicker
1868					.append(xdsoft_copyright);
1869            }
1870
1871            datepicker
1872				.append(month_picker)
1873				.append(calendar)
1874				.append(applyButton);
1875
1876            $(options.parentID)
1877				.append(datetimepicker);
1878
1879            XDSoft_datetime = function () {
1880                var _this = this;
1881                _this.now = function (norecursion) {
1882                    var d = new Date(),
1883						date,
1884						time;
1885
1886                    if (!norecursion && options.defaultDate) {
1887                        date = _this.strToDateTime(options.defaultDate);
1888                        d.setFullYear(date.getFullYear());
1889                        d.setMonth(date.getMonth());
1890                        d.setDate(date.getDate());
1891                    }
1892
1893                    if (options.yearOffset) {
1894                        d.setFullYear(d.getFullYear() + options.yearOffset);
1895                    }
1896
1897                    if (!norecursion && options.defaultTime) {
1898                        time = _this.strtotime(options.defaultTime);
1899                        d.setHours(time.getHours());
1900                        d.setMinutes(time.getMinutes());
1901                    }
1902                    return d;
1903                };
1904
1905                _this.isValidDate = function (d) {
1906                    if (Object.prototype.toString.call(d) !== "[object Date]") {
1907                        return false;
1908                    }
1909                    return !isNaN(d.getTime());
1910                };
1911
1912                _this.setCurrentTime = function (dTime, requireValidDate) {
1913                    if (typeof dTime === 'string') {
1914                        _this.currentTime = _this.strToDateTime(dTime);
1915                    }
1916                    else if (_this.isValidDate(dTime)) {
1917                        _this.currentTime = dTime;
1918                    }
1919                    else if (!dTime && !requireValidDate && options.allowBlank) {
1920                        _this.currentTime = null;
1921                    }
1922                    else {
1923                        _this.currentTime = _this.now();
1924                    }
1925
1926                    datetimepicker.trigger('xchange.xdsoft');
1927                };
1928
1929                _this.empty = function () {
1930                    _this.currentTime = null;
1931                };
1932
1933                _this.getCurrentTime = function (dTime) {
1934                    return _this.currentTime;
1935                };
1936
1937                _this.nextMonth = function () {
1938
1939                    if (_this.currentTime === undefined || _this.currentTime === null) {
1940                        _this.currentTime = _this.now();
1941                    }
1942
1943                    var month = _this.currentTime.getMonth() + 1,
1944						year;
1945                    if (month === 12) {
1946                        _this.currentTime.setFullYear(_this.currentTime.getFullYear() + 1);
1947                        month = 0;
1948                    }
1949
1950                    year = _this.currentTime.getFullYear();
1951
1952                    _this.currentTime.setDate(
1953						Math.min(
1954							new Date(_this.currentTime.getFullYear(), month + 1, 0).getDate(),
1955							_this.currentTime.getDate()
1956						)
1957					);
1958                    _this.currentTime.setMonth(month);
1959
1960                    if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) {
1961                        options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
1962                    }
1963
1964                    if (year !== _this.currentTime.getFullYear() && $.isFunction(options.onChangeYear)) {
1965                        options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
1966                    }
1967
1968
1969                    datetimepicker.trigger('xchange.xdsoft');
1970                    return month;
1971                };
1972
1973                _this.prevMonth = function () {
1974
1975                    if (_this.currentTime === undefined || _this.currentTime === null) {
1976                        _this.currentTime = _this.now();
1977                    }
1978
1979                    var month = _this.currentTime.getMonth() - 1;
1980                    if (month === -1) {
1981                        _this.currentTime.setFullYear(_this.currentTime.getFullYear() - 1);
1982                        month = 11;
1983                    }
1984                    _this.currentTime.setDate(
1985						Math.min(
1986							new Date(_this.currentTime.getFullYear(), month + 1, 0).getDate(),
1987							_this.currentTime.getDate()
1988						)
1989					);
1990                    _this.currentTime.setMonth(month);
1991                    if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) {
1992                        options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
1993                    }
1994                    datetimepicker.trigger('xchange.xdsoft');
1995                    return month;
1996                };
1997
1998                _this.getWeekOfYear = function (datetime) {
1999                    if (options.onGetWeekOfYear && $.isFunction(options.onGetWeekOfYear)) {
2000                        var week = options.onGetWeekOfYear.call(datetimepicker, datetime);
2001                        if (typeof week !== 'undefined') {
2002                            return week;
2003                        }
2004                    }
2005                    var onejan = new Date(datetime.getFullYear(), 0, 1);
2006                    //First week of the year is th one with the first Thursday according to ISO8601
2007                    if (onejan.getDay() != 4)
2008                        onejan.setMonth(0, 1 + ((4 - onejan.getDay() + 7) % 7));
2009                    return Math.ceil((((datetime - onejan) / 86400000) + onejan.getDay() + 1) / 7);
2010                };
2011
2012                _this.strToDateTime = function (sDateTime) {
2013                    var tmpDate = [], timeOffset, currentTime;
2014
2015                    if (sDateTime && sDateTime instanceof Date && _this.isValidDate(sDateTime)) {
2016                        return sDateTime;
2017                    }
2018
2019                    tmpDate = /^(\+|\-)(.*)$/.exec(sDateTime);
2020                    if (tmpDate) {
2021                        tmpDate[2] = dateHelper.parseDate(tmpDate[2], options.formatDate);
2022                    }
2023                    if (tmpDate && tmpDate[2]) {
2024                        timeOffset = tmpDate[2].getTime() - (tmpDate[2].getTimezoneOffset()) * 60000;
2025                        currentTime = new Date((_this.now(true)).getTime() + parseInt(tmpDate[1] + '1', 10) * timeOffset);
2026                    } else {
2027                        currentTime = sDateTime ? dateHelper.parseDate(sDateTime, options.format) : _this.now();
2028                    }
2029
2030                    if (!_this.isValidDate(currentTime)) {
2031                        currentTime = _this.now();
2032                    }
2033
2034                    return currentTime;
2035                };
2036
2037                _this.strToDate = function (sDate) {
2038                    if (sDate && sDate instanceof Date && _this.isValidDate(sDate)) {
2039                        return sDate;
2040                    }
2041
2042                    var currentTime = sDate ? dateHelper.parseDate(sDate, options.formatDate) : _this.now(true);
2043                    if (!_this.isValidDate(currentTime)) {
2044                        currentTime = _this.now(true);
2045                    }
2046                    return currentTime;
2047                };
2048
2049                _this.strtotime = function (sTime) {
2050                    if (sTime && sTime instanceof Date && _this.isValidDate(sTime)) {
2051                        return sTime;
2052                    }
2053                    var currentTime = sTime ? dateHelper.parseDate(sTime, options.formatTime) : _this.now(true);
2054                    if (!_this.isValidDate(currentTime)) {
2055                        currentTime = _this.now(true);
2056                    }
2057                    return currentTime;
2058                };
2059
2060                _this.str = function () {
2061                    return dateHelper.formatDate(_this.currentTime, options.format);
2062                };
2063                _this.currentTime = this.now();
2064            };
2065
2066            _xdsoft_datetime = new XDSoft_datetime();
2067
2068            applyButton.on('touchend click', function (e) {//pathbrite
2069                e.preventDefault();
2070                datetimepicker.data('changed', true);
2071                _xdsoft_datetime.setCurrentTime(getCurrentValue());
2072                input.val(_xdsoft_datetime.str());
2073                datetimepicker.trigger('close.xdsoft');
2074            });
2075            month_picker
2076				.find('.xdsoft_today_button')
2077				.on('touchend mouseup.xdsoft', function () {
2078				    datetimepicker.data('changed', true);
2079				    _xdsoft_datetime.setCurrentTime(0, true);
2080				    datetimepicker.trigger('afterOpen.xdsoft');
2081				}).on('dblclick.xdsoft', function () {
2082				    var currentDate = _xdsoft_datetime.getCurrentTime(), minDate, maxDate;
2083				    currentDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate());
2084				    minDate = _xdsoft_datetime.strToDate(options.minDate);
2085				    minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate());
2086				    if (currentDate < minDate) {
2087				        return;
2088				    }
2089				    maxDate = _xdsoft_datetime.strToDate(options.maxDate);
2090				    maxDate = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate());
2091				    if (currentDate > maxDate) {
2092				        return;
2093				    }
2094				    input.val(_xdsoft_datetime.str());
2095				    input.trigger('change');
2096				    datetimepicker.trigger('close.xdsoft');
2097				});
2098            month_picker
2099				.find('.xdsoft_prev,.xdsoft_next')
2100				.on('touchend mouseup.xdsoft', function () {
2101				    var $this = $(this),
2102						timer = 0,
2103						stop = false;
2104
2105				    (function arguments_callee1(v) {
2106				        if ($this.hasClass(options.next)) {
2107				            _xdsoft_datetime.nextMonth();
2108				        } else if ($this.hasClass(options.prev)) {
2109				            _xdsoft_datetime.prevMonth();
2110				        }
2111				        if (options.monthChangeSpinner) {
2112				            if (!stop) {
2113				                timer = setTimeout(arguments_callee1, v || 100);
2114				            }
2115				        }
2116				    }(500));
2117
2118				    $([document.body, window]).on('touchend mouseup.xdsoft', function arguments_callee2() {
2119				        clearTimeout(timer);
2120				        stop = true;
2121				        $([document.body, window]).off('touchend mouseup.xdsoft', arguments_callee2);
2122				    });
2123				});
2124
2125            timepicker
2126				.find('.xdsoft_prev,.xdsoft_next')
2127				.on('touchend mousedown.xdsoft', function () {
2128				    var $this = $(this),
2129						timer = 0,
2130						stop = false,
2131						period = 110;
2132				    (function arguments_callee4(v) {
2133				        var pheight = timeboxparent[0].clientHeight,
2134							height = timebox[0].offsetHeight,
2135							top = Math.abs(parseInt(timebox.css('marginTop'), 10));
2136				        if ($this.hasClass(options.next) && (height - pheight) - options.timeHeightInTimePicker >= top) {
2137				            timebox.css('marginTop', '-' + (top + options.timeHeightInTimePicker) + 'px');
2138				        } else if ($this.hasClass(options.prev) && top - options.timeHeightInTimePicker >= 0) {
2139				            timebox.css('marginTop', '-' + (top - options.timeHeightInTimePicker) + 'px');
2140				        }
2141				        /**
2142                         * Fixed bug:
2143                         * When using css3 transition, it will cause a bug that you cannot scroll the timepicker list.
2144                         * The reason is that the transition-duration time, if you set it to 0, all things fine, otherwise, this
2145                         * would cause a bug when you use jquery.css method.
2146                         * Let's say: * { transition: all .5s ease; }
2147                         * jquery timebox.css('marginTop') will return the original value which is before you clicking the next/prev button,
2148                         * meanwhile the timebox[0].style.marginTop will return the right value which is after you clicking the
2149                         * next/prev button.
2150                         * 
2151                         * What we should do:
2152                         * Replace timebox.css('marginTop') with timebox[0].style.marginTop.
2153                         */
2154				        timeboxparent.trigger('scroll_element.xdsoft_scroller', [Math.abs(parseInt(timebox[0].style.marginTop, 10) / (height - pheight))]);
2155				        //period = period;
2156				        period = (period > 10) ? 10 : period - 10;
2157				        if (!stop) {
2158				            timer = setTimeout(arguments_callee4, v || period);
2159				        }
2160				    }(500));
2161				    $([document.body, window]).on('touchend mouseup.xdsoft', function arguments_callee5() {
2162				        clearTimeout(timer);
2163				        stop = true;
2164				        $([document.body, window])
2165							.off('touchend mouseup.xdsoft', arguments_callee5);
2166				    });
2167				});
2168
2169            xchangeTimer = 0;
2170            // base handler - generating a calendar and timepicker
2171            datetimepicker
2172				.on('xchange.xdsoft', function (event) {
2173				    clearTimeout(xchangeTimer);
2174				    xchangeTimer = setTimeout(function () {
2175
2176				        if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null) {
2177				            //In case blanks are allowed, delay construction until we have a valid date 
2178				            if (options.allowBlank)
2179				                return;
2180
2181				            _xdsoft_datetime.currentTime = _xdsoft_datetime.now();
2182				        }
2183
2184				        var table = '',
2185							start = new Date(_xdsoft_datetime.currentTime.getFullYear(), _xdsoft_datetime.currentTime.getMonth(), 1, 12, 0, 0),
2186							i = 0,
2187							j,
2188							today = _xdsoft_datetime.now(),
2189							maxDate = false,
2190							minDate = false,
2191							hDate,
2192							day,
2193							d,
2194							y,
2195							m,
2196							w,
2197							classes = [],
2198							customDateSettings,
2199							newRow = true,
2200							time = '',
2201							h = '',
2202							line_time,
2203							description;
2204
2205				        while (start.getDay() !== options.dayOfWeekStart) {
2206				            start.setDate(start.getDate() - 1);
2207				        }
2208
2209				        table += '<table><thead><tr>';
2210
2211				        if (options.weeks) {
2212				            table += '<th></th>';
2213				        }
2214
2215				        for (j = 0; j < 7; j += 1) {
2216				            table += '<th>' + options.i18n[globalLocale].dayOfWeekShort[(j + options.dayOfWeekStart) % 7] + '</th>';
2217				        }
2218
2219				        table += '</tr></thead>';
2220				        table += '<tbody>';
2221
2222				        if (options.maxDate !== false) {
2223				            maxDate = _xdsoft_datetime.strToDate(options.maxDate);
2224				            maxDate = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate(), 23, 59, 59, 999);
2225				        }
2226
2227				        if (options.minDate !== false) {
2228				            minDate = _xdsoft_datetime.strToDate(options.minDate);
2229				            minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate());
2230				        }
2231
2232				        while (i < _xdsoft_datetime.currentTime.countDaysInMonth() || start.getDay() !== options.dayOfWeekStart || _xdsoft_datetime.currentTime.getMonth() === start.getMonth()) {
2233				            classes = [];
2234				            i += 1;
2235
2236				            day = start.getDay();
2237				            d = start.getDate();
2238				            y = start.getFullYear();
2239				            m = start.getMonth();
2240				            w = _xdsoft_datetime.getWeekOfYear(start);
2241				            description = '';
2242
2243				            classes.push('xdsoft_date');
2244
2245				            if (options.beforeShowDay && $.isFunction(options.beforeShowDay.call)) {
2246				                customDateSettings = options.beforeShowDay.call(datetimepicker, start);
2247				            } else {
2248				                customDateSettings = null;
2249				            }
2250
2251				            if (options.allowDateRe && Object.prototype.toString.call(options.allowDateRe) === "[object RegExp]") {
2252				                if (!options.allowDateRe.test(dateHelper.formatDate(start, options.formatDate))) {
2253				                    classes.push('xdsoft_disabled');
2254				                }
2255				            } else if (options.allowDates && options.allowDates.length > 0) {
2256				                if (options.allowDates.indexOf(dateHelper.formatDate(start, options.formatDate)) === -1) {
2257				                    classes.push('xdsoft_disabled');
2258				                }
2259				            } else if ((maxDate !== false && start > maxDate) || (minDate !== false && start < minDate) || (customDateSettings && customDateSettings[0] === false)) {
2260				                classes.push('xdsoft_disabled');
2261				            } else if (options.disabledDates.indexOf(dateHelper.formatDate(start, options.formatDate)) !== -1) {
2262				                classes.push('xdsoft_disabled');
2263				            } else if (options.disabledWeekDays.indexOf(day) !== -1) {
2264				                classes.push('xdsoft_disabled');
2265				            } else if (input.is('[readonly]')) {
2266				                classes.push('xdsoft_disabled');
2267				            }
2268
2269				            if (customDateSettings && customDateSettings[1] !== "") {
2270				                classes.push(customDateSettings[1]);
2271				            }
2272
2273				            if (_xdsoft_datetime.currentTime.getMonth() !== m) {
2274				                classes.push('xdsoft_other_month');
2275				            }
2276
2277				            if ((options.defaultSelect || datetimepicker.data('changed')) && dateHelper.formatDate(_xdsoft_datetime.currentTime, options.formatDate) === dateHelper.formatDate(start, options.formatDate)) {
2278				                classes.push('xdsoft_current');
2279				            }
2280
2281				            if (dateHelper.formatDate(today, options.formatDate) === dateHelper.formatDate(start, options.formatDate)) {
2282				                classes.push('xdsoft_today');
2283				            }
2284
2285				            if (start.getDay() === 0 || start.getDay() === 6 || options.weekends.indexOf(dateHelper.formatDate(start, options.formatDate)) !== -1) {
2286				                classes.push('xdsoft_weekend');
2287				            }
2288
2289				            if (options.highlightedDates[dateHelper.formatDate(start, options.formatDate)] !== undefined) {
2290				                hDate = options.highlightedDates[dateHelper.formatDate(start, options.formatDate)];
2291				                classes.push(hDate.style === undefined ? 'xdsoft_highlighted_default' : hDate.style);
2292				                description = hDate.desc === undefined ? '' : hDate.desc;
2293				            }
2294
2295				            if (options.beforeShowDay && $.isFunction(options.beforeShowDay)) {
2296				                classes.push(options.beforeShowDay(start));
2297				            }
2298
2299				            if (newRow) {
2300				                table += '<tr>';
2301				                newRow = false;
2302				                if (options.weeks) {
2303				                    table += '<th>' + w + '</th>';
2304				                }
2305				            }
2306
2307				            table += '<td data-date="' + d + '" data-month="' + m + '" data-year="' + y + '"' + ' class="xdsoft_date xdsoft_day_of_week' + start.getDay() + ' ' + classes.join(' ') + '" title="' + description + '">' +
2308										'<div>' + d + '</div>' +
2309									'</td>';
2310
2311				            if (start.getDay() === options.dayOfWeekStartPrev) {
2312				                table += '</tr>';
2313				                newRow = true;
2314				            }
2315
2316				            start.setDate(d + 1);
2317				        }
2318				        table += '</tbody></table>';
2319
2320				        calendar.html(table);
2321
2322				        month_picker.find('.xdsoft_label span').eq(0).text(options.i18n[globalLocale].months[_xdsoft_datetime.currentTime.getMonth()]);
2323				        month_picker.find('.xdsoft_label span').eq(1).text(_xdsoft_datetime.currentTime.getFullYear());
2324
2325				        // generate timebox
2326				        time = '';
2327				        h = '';
2328				        m = '';
2329
2330				        line_time = function line_time(h, m) {
2331				            var now = _xdsoft_datetime.now(), optionDateTime, current_time,
2332								isALlowTimesInit = options.allowTimes && $.isArray(options.allowTimes) && options.allowTimes.length;
2333				            now.setHours(h);
2334				            h = parseInt(now.getHours(), 10);
2335				            now.setMinutes(m);
2336				            m = parseInt(now.getMinutes(), 10);
2337				            optionDateTime = new Date(_xdsoft_datetime.currentTime);
2338				            optionDateTime.setHours(h);
2339				            optionDateTime.setMinutes(m);
2340				            classes = [];
2341				            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())) {
2342				                classes.push('xdsoft_disabled');
2343				            } else if ((options.minDateTime !== false && options.minDateTime > optionDateTime) || ((options.disabledMinTime !== false && now.getTime() > _xdsoft_datetime.strtotime(options.disabledMinTime).getTime()) && (options.disabledMaxTime !== false && now.getTime() < _xdsoft_datetime.strtotime(options.disabledMaxTime).getTime()))) {
2344				                classes.push('xdsoft_disabled');
2345				            } else if (input.is('[readonly]')) {
2346				                classes.push('xdsoft_disabled');
2347				            }
2348
2349				            current_time = new Date(_xdsoft_datetime.currentTime);
2350				            current_time.setHours(parseInt(_xdsoft_datetime.currentTime.getHours(), 10));
2351
2352				            if (!isALlowTimesInit) {
2353				                current_time.setMinutes(Math[options.roundTime](_xdsoft_datetime.currentTime.getMinutes() / options.step) * options.step);
2354				            }
2355
2356				            if ((options.initTime || options.defaultSelect || datetimepicker.data('changed')) && current_time.getHours() === parseInt(h, 10) && ((!isALlowTimesInit && options.step > 59) || current_time.getMinutes() === parseInt(m, 10))) {
2357				                if (options.defaultSelect || datetimepicker.data('changed')) {
2358				                    classes.push('xdsoft_current');  /* stop init selection OFC ****** */
2359				                } else if (options.initTime) {
2360				                    classes.push('xdsoft_init_time');
2361				                }
2362				            }
2363				            if (parseInt(today.getHours(), 10) === parseInt(h, 10) && parseInt(today.getMinutes(), 10) === parseInt(m, 10)) {
2364				                classes.push('xdsoft_today');
2365				            }
2366				            time += '<div class="xdsoft_time ' + classes.join(' ') + '" data-hour="' + h + '" data-minute="' + m + '">' + dateHelper.formatDate(now, options.formatTime) + '</div>';
2367				        };
2368
2369				        if (!options.allowTimes || !$.isArray(options.allowTimes) || !options.allowTimes.length) {
2370				            for (i = 0, j = 0; i < (options.hours12 ? 12 : 24) ; i += 1) {	// offset by 6 /* OFC UPDATE ************ */
2371				                for (j = 0; j < 60; j += options.step) {
2372				                    h = (i < 10 ? '0' : '') + i;
2373				                    m = (j < 10 ? '0' : '') + j;
2374				                    line_time(h, m);
2375				                }
2376				            }
2377				        } else {
2378				            for (i = 0; i < options.allowTimes.length; i += 1) {
2379				                h = _xdsoft_datetime.strtotime(options.allowTimes[i]).getHours();
2380				                m = _xdsoft_datetime.strtotime(options.allowTimes[i]).getMinutes();
2381				                line_time(h, m);
2382				            }
2383				        }
2384
2385				        timebox.html(time);
2386
2387				        opt = '';
2388				        i = 0;
2389
2390				        for (i = parseInt(options.yearStart, 10) + options.yearOffset; i <= parseInt(options.yearEnd, 10) + options.yearOffset; i += 1) {
2391				            opt += '<div class="xdsoft_option ' + (_xdsoft_datetime.currentTime.getFullYear() === i ? 'xdsoft_current' : '') + '" data-value="' + i + '">' + i + '</div>';
2392				        }
2393				        yearselect.children().eq(0)
2394												.html(opt);
2395
2396				        for (i = parseInt(options.monthStart, 10), opt = ''; i <= parseInt(options.monthEnd, 10) ; i += 1) {
2397				            opt += '<div class="xdsoft_option ' + (_xdsoft_datetime.currentTime.getMonth() === i ? 'xdsoft_current' : '') + '" data-value="' + i + '">' + options.i18n[globalLocale].months[i] + '</div>';
2398				        }
2399				        monthselect.children().eq(0).html(opt);
2400				        $(datetimepicker)
2401							.trigger('generate.xdsoft');
2402				    }, 10);
2403				    event.stopPropagation();
2404				})
2405				.on('afterOpen.xdsoft', function () {
2406				    if (options.timepicker) {
2407				        var classType, pheight, height, top;
2408				        if (timebox.find('.xdsoft_current').length) {
2409				            classType = '.xdsoft_current';
2410				        } else if (timebox.find('.xdsoft_init_time').length) {
2411				            classType = '.xdsoft_init_time';
2412				        }
2413				        if (classType) {
2414				            pheight = timeboxparent[0].clientHeight;
2415				            height = timebox[0].offsetHeight;
2416				            top = timebox.find(classType).index() * options.timeHeightInTimePicker + 1;
2417				            if ((height - pheight) < top) {
2418				                top = height - pheight;
2419				            }
2420				            timeboxparent.trigger('scroll_element.xdsoft_scroller', [parseInt(top, 10) / (height - pheight - 600)]);
2421				            /* increase offset -600 OFC UPDATE ******** */
2422				        } else {
2423				            timeboxparent.trigger('scroll_element.xdsoft_scroller', [0]);
2424				        }
2425				    }
2426				});
2427
2428            timerclick = 0;
2429            calendar
2430				.on('touchend click.xdsoft', 'td', function (xdevent) {
2431				    xdevent.stopPropagation();  // Prevents closing of Pop-ups, Modals and Flyouts in Bootstrap
2432				    timerclick += 1;
2433				    var $this = $(this),
2434						currentTime = _xdsoft_datetime.currentTime;
2435
2436				    if (currentTime === undefined || currentTime === null) {
2437				        _xdsoft_datetime.currentTime = _xdsoft_datetime.now();
2438				        currentTime = _xdsoft_datetime.currentTime;
2439				    }
2440
2441				    if ($this.hasClass('xdsoft_disabled')) {
2442				        return false;
2443				    }
2444
2445				    currentTime.setDate(1);
2446				    currentTime.setFullYear($this.data('year'));
2447				    currentTime.setMonth($this.data('month'));
2448				    currentTime.setDate($this.data('date'));
2449
2450				    datetimepicker.trigger('select.xdsoft', [currentTime]);
2451
2452				    input.val(_xdsoft_datetime.str());
2453
2454				    if (options.onSelectDate && $.isFunction(options.onSelectDate)) {
2455				        options.onSelectDate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent);
2456				    }
2457
2458				    datetimepicker.data('changed', true);
2459				    datetimepicker.trigger('xchange.xdsoft');
2460				    datetimepicker.trigger('changedatetime.xdsoft');
2461				    if ((timerclick > 1 || (options.closeOnDateSelect === true || (options.closeOnDateSelect === false && !options.timepicker))) && !options.inline) {
2462				        datetimepicker.trigger('close.xdsoft');
2463				    }
2464				    setTimeout(function () {
2465				        timerclick = 0;
2466				    }, 200);
2467				});
2468
2469            timebox
2470				.on('touchmove', 'div', function () { currentlyScrollingTimeDiv = true; })
2471				.on('touchend click.xdsoft', 'div', function (xdevent) {
2472				    xdevent.stopPropagation();
2473				    if (currentlyScrollingTimeDiv) {
2474				        currentlyScrollingTimeDiv = false;
2475				        return;
2476				    }
2477				    var $this = $(this),
2478						currentTime = _xdsoft_datetime.currentTime;
2479
2480				    if (currentTime === undefined || currentTime === null) {
2481				        _xdsoft_datetime.currentTime = _xdsoft_datetime.now();
2482				        currentTime = _xdsoft_datetime.currentTime;
2483				    }
2484
2485				    if ($this.hasClass('xdsoft_disabled')) {
2486				        return false;
2487				    }
2488				    currentTime.setHours($this.data('hour'));
2489				    currentTime.setMinutes($this.data('minute'));
2490				    datetimepicker.trigger('select.xdsoft', [currentTime]);
2491
2492				    datetimepicker.data('input').val(_xdsoft_datetime.str());
2493
2494				    if (options.onSelectTime && $.isFunction(options.onSelectTime)) {
2495				        options.onSelectTime.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent);
2496				    }
2497				    datetimepicker.data('changed', true);
2498				    datetimepicker.trigger('xchange.xdsoft');
2499				    datetimepicker.trigger('changedatetime.xdsoft');
2500				    if (options.inline !== true && options.closeOnTimeSelect === true) {
2501				        datetimepicker.trigger('close.xdsoft');
2502				    }
2503				});
2504
2505            datepicker
2506				.on('mousewheel.xdsoft', function (event) {
2507				    if (!options.scrollMonth) {
2508				        return true;
2509				    }
2510				    if (event.deltaY < 0) {
2511				        _xdsoft_datetime.nextMonth();
2512				    } else {
2513				        _xdsoft_datetime.prevMonth();
2514				    }
2515				    return false;
2516				});
2517
2518            input
2519				.on('mousewheel.xdsoft', function (event) {
2520				    if (!options.scrollInput) {
2521				        return true;
2522				    }
2523				    if (!options.datepicker && options.timepicker) {
2524				        current_time_index = timebox.find('.xdsoft_current').length ? timebox.find('.xdsoft_current').eq(0).index() : 0;
2525				        if (current_time_index + event.deltaY >= 0 && current_time_index + event.deltaY < timebox.children().length) {
2526				            current_time_index += event.deltaY;
2527				        }
2528				        if (timebox.children().eq(current_time_index).length) {
2529				            timebox.children().eq(current_time_index).trigger('mousedown');
2530				        }
2531				        return false;
2532				    }
2533				    if (options.datepicker && !options.timepicker) {
2534				        datepicker.trigger(event, [event.deltaY, event.deltaX, event.deltaY]);
2535				        if (input.val) {
2536				            input.val(_xdsoft_datetime.str());
2537				        }
2538				        datetimepicker.trigger('changedatetime.xdsoft');
2539				        return false;
2540				    }
2541				});
2542
2543            datetimepicker
2544				.on('changedatetime.xdsoft', function (event) {
2545				    if (options.onChangeDateTime && $.isFunction(options.onChangeDateTime)) {
2546				        var $input = datetimepicker.data('input');
2547				        options.onChangeDateTime.call(datetimepicker, _xdsoft_datetime.currentTime, $input, event);
2548				        delete options.value;
2549				        $input.trigger('change');
2550				    }
2551				})
2552				.on('generate.xdsoft', function () {
2553				    if (options.onGenerate && $.isFunction(options.onGenerate)) {
2554				        options.onGenerate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
2555				    }
2556				    if (triggerAfterOpen) {
2557				        datetimepicker.trigger('afterOpen.xdsoft');
2558				        triggerAfterOpen = false;
2559				    }
2560				})
2561				.on('click.xdsoft', function (xdevent) {
2562				    xdevent.stopPropagation();
2563				});
2564
2565            current_time_index = 0;
2566
2567            /**
2568			 * Runs the callback for each of the specified node's ancestors.
2569			 *
2570			 * Return FALSE from the callback to stop ascending.
2571			 *
2572			 * @param {DOMNode} node
2573			 * @param {Function} callback
2574			 * @returns {undefined}
2575			 */
2576            forEachAncestorOf = function (node, callback) {
2577                do {
2578                    node = node.parentNode;
2579
2580                    if (callback(node) === false) {
2581                        break;
2582                    }
2583                } while (node.nodeName !== 'HTML');
2584            };
2585
2586            /**
2587			 * Sets the position of the picker.
2588			 *
2589			 * @returns {undefined}
2590			 */
2591            setPos = function () {
2592                var dateInputOffset,
2593					dateInputElem,
2594					verticalPosition,
2595					left,
2596					position,
2597					datetimepickerElem,
2598					dateInputHasFixedAncestor,
2599					$dateInput,
2600					windowWidth,
2601					verticalAnchorEdge,
2602					datetimepickerCss,
2603					windowHeight,
2604					windowScrollTop;
2605
2606                $dateInput = datetimepicker.data('input');
2607                dateInputOffset = $dateInput.offset();
2608                dateInputElem = $dateInput[0];
2609
2610                verticalAnchorEdge = 'top';
2611                verticalPosition = (dateInputOffset.top + dateInputElem.offsetHeight) - 1;
2612                left = dateInputOffset.left;
2613                position = "absolute";
2614
2615                windowWidth = $(window).width();
2616                windowHeight = $(window).height();
2617                windowScrollTop = $(window).scrollTop();
2618
2619                if ((document.documentElement.clientWidth - dateInputOffset.left) < datepicker.parent().outerWidth(true)) {
2620                    var diff = datepicker.parent().outerWidth(true) - dateInputElem.offsetWidth;
2621                    left = left - diff;
2622                }
2623
2624                if ($dateInput.parent().css('direction') === 'rtl') {
2625                    left -= (datetimepicker.outerWidth() - $dateInput.outerWidth());
2626                }
2627
2628                if (options.fixed) {
2629                    verticalPosition -= windowScrollTop;
2630                    left -= $(window).scrollLeft();
2631                    position = "fixed";
2632                } else {
2633                    dateInputHasFixedAncestor = false;
2634
2635                    forEachAncestorOf(dateInputElem, function (ancestorNode) {
2636                        if (window.getComputedStyle(ancestorNode).getPropertyValue('position') === 'fixed') {
2637                            dateInputHasFixedAncestor = true;
2638                            return false;
2639                        }
2640                    });
2641
2642                    if (dateInputHasFixedAncestor) {
2643                        position = 'fixed';
2644
2645                        //If the picker won't fit entirely within the viewport then display it above the date input.
2646                        if (verticalPosition + datetimepicker.outerHeight() > windowHeight + windowScrollTop) {
2647                            verticalAnchorEdge = 'bottom';
2648                            verticalPosition = (windowHeight + windowScrollTop) - dateInputOffset.top;
2649                        } else {
2650                            verticalPosition -= windowScrollTop;
2651                        }
2652                    } else {
2653                        if (verticalPosition + dateInputElem.offsetHeight > windowHeight + windowScrollTop) {
2654                            verticalPosition = dateInputOffset.top - dateInputElem.offsetHeight + 1;
2655                        }
2656                    }
2657
2658                    if (verticalPosition < 0) {
2659                        verticalPosition = 0;
2660                    }
2661
2662                    if (left + dateInputElem.offsetWidth > windowWidth) {
2663                        left = windowWidth - dateInputElem.offsetWidth;
2664                    }
2665                }
2666
2667                datetimepickerElem = datetimepicker[0];
2668
2669                forEachAncestorOf(datetimepickerElem, function (ancestorNode) {
2670                    var ancestorNodePosition;
2671
2672                    ancestorNodePosition = window.getComputedStyle(ancestorNode).getPropertyValue('position');
2673
2674                    if (ancestorNodePosition === 'relative' && windowWidth >= ancestorNode.offsetWidth) {
2675                        left = left - ((windowWidth - ancestorNode.offsetWidth) / 2);
2676                        return false;
2677                    }
2678                });
2679
2680                datetimepickerCss = {
2681                    position: position,
2682                    left: left,
2683                    top: '',  //Initialize to prevent previous values interfering with new ones.
2684                    bottom: ''  //Initialize to prevent previous values interfering with new ones.
2685                };
2686
2687                datetimepickerCss[verticalAnchorEdge] = verticalPosition;
2688
2689                datetimepicker.css(datetimepickerCss);
2690            };
2691
2692            datetimepicker
2693				.on('open.xdsoft', function (event) {
2694				    var onShow = true;
2695				    if (options.onShow && $.isFunction(options.onShow)) {
2696				        onShow = options.onShow.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event);
2697				    }
2698				    if (onShow !== false) {
2699				        datetimepicker.show();
2700				        setPos();
2701				        $(window)
2702							.off('resize.xdsoft', setPos)
2703							.on('resize.xdsoft', setPos);
2704
2705				        if (options.closeOnWithoutClick) {
2706				            $([document.body, window]).on('touchstart mousedown.xdsoft', function arguments_callee6() {
2707				                datetimepicker.trigger('close.xdsoft');
2708				                $([document.body, window]).off('touchstart mousedown.xdsoft', arguments_callee6);
2709				            });
2710				        }
2711				    }
2712				})
2713				.on('close.xdsoft', function (event) {
2714				    var onClose = true;
2715				    month_picker
2716						.find('.xdsoft_month,.xdsoft_year')
2717							.find('.xdsoft_select')
2718								.hide();
2719				    if (options.onClose && $.isFunction(options.onClose)) {
2720				        onClose = options.onClose.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event);
2721				    }
2722				    if (onClose !== false && !options.opened && !options.inline) {
2723				        datetimepicker.hide();
2724				    }
2725				    event.stopPropagation();
2726				})
2727				.on('toggle.xdsoft', function () {
2728				    if (datetimepicker.is(':visible')) {
2729				        datetimepicker.trigger('close.xdsoft');
2730				    } else {
2731				        datetimepicker.trigger('open.xdsoft');
2732				    }
2733				})
2734				.data('input', input);
2735
2736            timer = 0;
2737
2738            datetimepicker.data('xdsoft_datetime', _xdsoft_datetime);
2739            datetimepicker.setOptions(options);
2740
2741            function getCurrentValue() {
2742                var ct = false, time;
2743
2744                if (options.startDate) {
2745                    ct = _xdsoft_datetime.strToDate(options.startDate);
2746                } else {
2747                    ct = options.value || ((input && input.val && input.val()) ? input.val() : '');
2748                    if (ct) {
2749                        ct = _xdsoft_datetime.strToDateTime(ct);
2750                    } else if (options.defaultDate) {
2751                        ct = _xdsoft_datetime.strToDateTime(options.defaultDate);
2752                        if (options.defaultTime) {
2753                            time = _xdsoft_datetime.strtotime(options.defaultTime);
2754                            ct.setHours(time.getHours());
2755                            ct.setMinutes(time.getMinutes());
2756                        }
2757                    }
2758                }
2759
2760                if (ct && _xdsoft_datetime.isValidDate(ct)) {
2761                    datetimepicker.data('changed', true);
2762                } else {
2763                    ct = '';
2764                }
2765
2766                return ct || 0;
2767            }
2768
2769            function setMask(options) {
2770
2771                var isValidValue = function (mask, value) {
2772                    var reg = mask
2773						.replace(/([\[\]\/\{\}\(\)\-\.\+]{1})/g, '\\$1')
2774						.replace(/_/g, '{digit+}')
2775						.replace(/([0-9]{1})/g, '{digit$1}')
2776						.replace(/\{digit([0-9]{1})\}/g, '[0-$1_]{1}')
2777						.replace(/\{digit[\+]\}/g, '[0-9_]{1}');
2778                    return (new RegExp(reg)).test(value);
2779                },
2780				getCaretPos = function (input) {
2781				    try {
2782				        if (document.selection && document.selection.createRange) {
2783				            var range = document.selection.createRange();
2784				            return range.getBookmark().charCodeAt(2) - 2;
2785				        }
2786				        if (input.setSelectionRange) {
2787				            return input.selectionStart;
2788				        }
2789				    } catch (e) {
2790				        return 0;
2791				    }
2792				},
2793				setCaretPos = function (node, pos) {
2794				    node = (typeof node === "string" || node instanceof String) ? document.getElementById(node) : node;
2795				    if (!node) {
2796				        return false;
2797				    }
2798				    if (node.createTextRange) {
2799				        var textRange = node.createTextRange();
2800				        textRange.collapse(true);
2801				        textRange.moveEnd('character', pos);
2802				        textRange.moveStart('character', pos);
2803				        textRange.select();
2804				        return true;
2805				    }
2806				    if (node.setSelectionRange) {
2807				        node.setSelectionRange(pos, pos);
2808				        return true;
2809				    }
2810				    return false;
2811				};
2812                if (options.mask) {
2813                    input.off('keydown.xdsoft');
2814                }
2815                if (options.mask === true) {
2816                    if (typeof moment != 'undefined') {
2817                        options.mask = options.format
2818                                .replace(/Y{4}/g, '9999')
2819                                .replace(/Y{2}/g, '99')
2820                                .replace(/M{2}/g, '19')
2821                                .replace(/D{2}/g, '39')
2822                                .replace(/H{2}/g, '29')
2823                                .replace(/m{2}/g, '59')
2824                                .replace(/s{2}/g, '59');
2825                    } else {
2826                        options.mask = options.format
2827                                .replace(/Y/g, '9999')
2828                                .replace(/F/g, '9999')
2829                                .replace(/m/g, '19')
2830                                .replace(/d/g, '39')
2831                                .replace(/H/g, '29')
2832                                .replace(/i/g, '59')
2833                                .replace(/s/g, '59');
2834                    }
2835                }
2836
2837                if ($.type(options.mask) === 'string') {
2838                    if (!isValidValue(options.mask, input.val())) {
2839                        input.val(options.mask.replace(/[0-9]/g, '_'));
2840                        setCaretPos(input[0], 0);
2841                    }
2842
2843                    input.on('keydown.xdsoft', function (event) {
2844                        var val = this.value,
2845							key = event.which,
2846							pos,
2847							digit;
2848
2849                        if (((key >= KEY0 && key <= KEY9) || (key >= _KEY0 && key <= _KEY9)) || (key === BACKSPACE || key === DEL)) {
2850                            pos = getCaretPos(this);
2851                            digit = (key !== BACKSPACE && key !== DEL) ? String.fromCharCode((_KEY0 <= key && key <= _KEY9) ? key - KEY0 : key) : '_';
2852
2853                            if ((key === BACKSPACE || key === DEL) && pos) {
2854                                pos -= 1;
2855                                digit = '_';
2856                            }
2857
2858                            while (/[^0-9_]/.test(options.mask.substr(pos, 1)) && pos < options.mask.length && pos > 0) {
2859                                pos += (key === BACKSPACE || key === DEL) ? -1 : 1;
2860                            }
2861
2862                            val = val.substr(0, pos) + digit + val.substr(pos + 1);
2863                            if ($.trim(val) === '') {
2864                                val = options.mask.replace(/[0-9]/g, '_');
2865                            } else {
2866                                if (pos === options.mask.length) {
2867                                    event.preventDefault();
2868                                    return false;
vendor: 12,309 bytes, lines 2869-3201
2869                                }
2870                            }
2871
2872                            pos += (key === BACKSPACE || key === DEL) ? 0 : 1;
2873                            while (/[^0-9_]/.test(options.mask.substr(pos, 1)) && pos < options.mask.length && pos > 0) {
2874                                pos += (key === BACKSPACE || key === DEL) ? -1 : 1;
2875                            }
2876
2877                            if (isValidValue(options.mask, val)) {
2878                                this.value = val;
2879                                setCaretPos(this, pos);
2880                            } else if ($.trim(val) === '') {
2881                                this.value = options.mask.replace(/[0-9]/g, '_');
2882                            } else {
2883                                input.trigger('error_input.xdsoft');
2884                            }
2885                        } else {
2886                            if (([AKEY, CKEY, VKEY, ZKEY, YKEY].indexOf(key) !== -1 && ctrlDown) || [ESC, ARROWUP, ARROWDOWN, ARROWLEFT, ARROWRIGHT, F5, CTRLKEY, TAB, ENTER].indexOf(key) !== -1) {
2887                                return true;
2888                            }
2889                        }
2890
2891                        event.preventDefault();
2892                        return false;
2893                    });
2894                }
2895            }
2896
2897            _xdsoft_datetime.setCurrentTime(getCurrentValue());
2898
2899            input
2900				.data('xdsoft_datetimepicker', datetimepicker)
2901				.on('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', function () {
2902				    if (input.is(':disabled') || (input.data('xdsoft_datetimepicker').is(':visible') && options.closeOnInputClick)) {
2903				        return;
2904				    }
2905				    clearTimeout(timer);
2906				    timer = setTimeout(function () {
2907				        if (input.is(':disabled')) {
2908				            return;
2909				        }
2910
2911				        triggerAfterOpen = true;
2912				        _xdsoft_datetime.setCurrentTime(getCurrentValue(), true);
2913				        if (options.mask) {
2914				            setMask(options);
2915				        }
2916				        datetimepicker.trigger('open.xdsoft');
2917				    }, 100);
2918				})
2919				.on('keydown.xdsoft', function (event) {
2920				    var elementSelector,
2921						key = event.which;
2922				    if ([ENTER].indexOf(key) !== -1 && options.enterLikeTab) {
2923				        elementSelector = $("input:visible,textarea:visible,button:visible,a:visible");
2924				        datetimepicker.trigger('close.xdsoft');
2925				        elementSelector.eq(elementSelector.index(this) + 1).focus();
2926				        return false;
2927				    }
2928				    if ([TAB].indexOf(key) !== -1) {
2929				        datetimepicker.trigger('close.xdsoft');
2930				        return true;
2931				    }
2932				})
2933				.on('blur.xdsoft', function () {
2934				    datetimepicker.trigger('close.xdsoft');
2935				});
2936        };
2937        destroyDateTimePicker = function (input) {
2938            var datetimepicker = input.data('xdsoft_datetimepicker');
2939            if (datetimepicker) {
2940                datetimepicker.data('xdsoft_datetime', null);
2941                datetimepicker.remove();
2942                input
2943					.data('xdsoft_datetimepicker', null)
2944					.off('.xdsoft');
2945                $(window).off('resize.xdsoft');
2946                $([window, document.body]).off('mousedown.xdsoft touchstart');
2947                if (input.unmousewheel) {
2948                    input.unmousewheel();
2949                }
2950            }
2951        };
2952        $(document)
2953			.off('keydown.xdsoftctrl keyup.xdsoftctrl')
2954			.on('keydown.xdsoftctrl', function (e) {
2955			    if (e.keyCode === CTRLKEY) {
2956			        ctrlDown = true;
2957			    }
2958			})
2959			.on('keyup.xdsoftctrl', function (e) {
2960			    if (e.keyCode === CTRLKEY) {
2961			        ctrlDown = false;
2962			    }
2963			});
2964
2965        this.each(function () {
2966            var datetimepicker = $(this).data('xdsoft_datetimepicker'), $input;
2967            if (datetimepicker) {
2968                if ($.type(opt) === 'string') {
2969                    switch (opt) {
2970                        case 'show':
2971                            $(this).select().focus();
2972                            datetimepicker.trigger('open.xdsoft');
2973                            break;
2974                        case 'hide':
2975                            datetimepicker.trigger('close.xdsoft');
2976                            break;
2977                        case 'toggle':
2978                            datetimepicker.trigger('toggle.xdsoft');
2979                            break;
2980                        case 'destroy':
2981                            destroyDateTimePicker($(this));
2982                            break;
2983                        case 'reset':
2984                            this.value = this.defaultValue;
2985                            if (!this.value || !datetimepicker.data('xdsoft_datetime').isValidDate(dateHelper.parseDate(this.value, options.format))) {
2986                                datetimepicker.data('changed', false);
2987                            }
2988                            datetimepicker.data('xdsoft_datetime').setCurrentTime(this.value);
2989                            break;
2990                        case 'validate':
2991                            $input = datetimepicker.data('input');
2992                            $input.trigger('blur.xdsoft');
2993                            break;
2994                        default:
2995                            if (datetimepicker[opt] && $.isFunction(datetimepicker[opt])) {
2996                                result = datetimepicker[opt](opt2);
2997                            }
2998                    }
2999                } else {
3000                    datetimepicker
3001						.setOptions(opt);
3002                }
3003                return 0;
3004            }
3005            if ($.type(opt) !== 'string') {
3006                if (!options.lazyInit || options.open || options.inline) {
3007                    createDateTimePicker($(this));
3008                } else {
3009                    lazyInit($(this));
3010                }
3011            }
3012        });
3013
3014        return result;
3015    };
3016
3017    $.fn.datetimepicker.defaults = default_options;
3018
3019    function HighlightedDate(date, desc, style) {
3020        "use strict";
3021        this.date = date;
3022        this.desc = desc;
3023        this.style = style;
3024    }
3025}));
3026/*!
3027 * jQuery Mousewheel 3.1.13
3028 *
3029 * Copyright jQuery Foundation and other contributors
3030 * Released under the MIT license
3031 * http://jquery.org/license
3032 */
3033
3034(function (factory) {
3035    if (typeof define === 'function' && define.amd) {
3036        // AMD. Register as an anonymous module.
3037        define(['jquery'], factory);
3038    } else if (typeof exports === 'object') {
3039        // Node/CommonJS style for Browserify
3040        module.exports = factory;
3041    } else {
3042        // Browser globals
3043        factory(jQuery);
3044    }
3045}(function ($) {
3046
3047    var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],
3048        toBind = ('onwheel' in document || document.documentMode >= 9) ?
3049                    ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],
3050        slice = Array.prototype.slice,
3051        nullLowestDeltaTimeout, lowestDelta;
3052
3053    if ($.event.fixHooks) {
3054        for (var i = toFix.length; i;) {
3055            $.event.fixHooks[toFix[--i]] = $.event.mouseHooks;
3056        }
3057    }
3058
3059    var special = $.event.special.mousewheel = {
3060        version: '3.1.12',
3061
3062        setup: function () {
3063            if (this.addEventListener) {
3064                for (var i = toBind.length; i;) {
3065                    this.addEventListener(toBind[--i], handler, false);
3066                }
3067            } else {
3068                this.onmousewheel = handler;
3069            }
3070            // Store the line height and page height for this particular element
3071            $.data(this, 'mousewheel-line-height', special.getLineHeight(this));
3072            $.data(this, 'mousewheel-page-height', special.getPageHeight(this));
3073        },
3074
3075        teardown: function () {
3076            if (this.removeEventListener) {
3077                for (var i = toBind.length; i;) {
3078                    this.removeEventListener(toBind[--i], handler, false);
3079                }
3080            } else {
3081                this.onmousewheel = null;
3082            }
3083            // Clean up the data we added to the element
3084            $.removeData(this, 'mousewheel-line-height');
3085            $.removeData(this, 'mousewheel-page-height');
3086        },
3087
3088        getLineHeight: function (elem) {
3089            var $elem = $(elem),
3090                $parent = $elem['offsetParent' in $.fn ? 'offsetParent' : 'parent']();
3091            if (!$parent.length) {
3092                $parent = $('body');
3093            }
3094            return parseInt($parent.css('fontSize'), 10) || parseInt($elem.css('fontSize'), 10) || 16;
3095        },
3096
3097        getPageHeight: function (elem) {
3098            return $(elem).height();
3099        },
3100
3101        settings: {
3102            adjustOldDeltas: true, // see shouldAdjustOldDeltas() below
3103            normalizeOffset: true  // calls getBoundingClientRect for each event
3104        }
3105    };
3106
3107    $.fn.extend({
3108        mousewheel: function (fn) {
3109            return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel');
3110        },
3111
3112        unmousewheel: function (fn) {
3113            return this.unbind('mousewheel', fn);
3114        }
3115    });
3116
3117
3118    function handler(event) {
3119        var orgEvent = event || window.event,
3120            args = slice.call(arguments, 1),
3121            delta = 0,
3122            deltaX = 0,
3123            deltaY = 0,
3124            absDelta = 0,
3125            offsetX = 0,
3126            offsetY = 0;
3127        event = $.event.fix(orgEvent);
3128        event.type = 'mousewheel';
3129
3130        // Old school scrollwheel delta
3131        if ('detail' in orgEvent) { deltaY = orgEvent.detail * -1; }
3132        if ('wheelDelta' in orgEvent) { deltaY = orgEvent.wheelDelta; }
3133        if ('wheelDeltaY' in orgEvent) { deltaY = orgEvent.wheelDeltaY; }
3134        if ('wheelDeltaX' in orgEvent) { deltaX = orgEvent.wheelDeltaX * -1; }
3135
3136        // Firefox < 17 horizontal scrolling related to DOMMouseScroll event
3137        if ('axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS) {
3138            deltaX = deltaY * -1;
3139            deltaY = 0;
3140        }
3141
3142        // Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy
3143        delta = deltaY === 0 ? deltaX : deltaY;
3144
3145        // New school wheel delta (wheel event)
3146        if ('deltaY' in orgEvent) {
3147            deltaY = orgEvent.deltaY * -1;
3148            delta = deltaY;
3149        }
3150        if ('deltaX' in orgEvent) {
3151            deltaX = orgEvent.deltaX;
3152            if (deltaY === 0) { delta = deltaX * -1; }
3153        }
3154
3155        // No change actually happened, no reason to go any further
3156        if (deltaY === 0 && deltaX === 0) { return; }
3157
3158        // Need to convert lines and pages to pixels if we aren't already in pixels
3159        // There are three delta modes:
3160        //   * deltaMode 0 is by pixels, nothing to do
3161        //   * deltaMode 1 is by lines
3162        //   * deltaMode 2 is by pages
3163        if (orgEvent.deltaMode === 1) {
3164            var lineHeight = $.data(this, 'mousewheel-line-height');
3165            delta *= lineHeight;
3166            deltaY *= lineHeight;
3167            deltaX *= lineHeight;
3168        } else if (orgEvent.deltaMode === 2) {
3169            var pageHeight = $.data(this, 'mousewheel-page-height');
3170            delta *= pageHeight;
3171            deltaY *= pageHeight;
3172            deltaX *= pageHeight;
3173        }
3174
3175        // Store lowest absolute delta to normalize the delta values
3176        absDelta = Math.max(Math.abs(deltaY), Math.abs(deltaX));
3177
3178        if (!lowestDelta || absDelta < lowestDelta) {
3179            lowestDelta = absDelta;
3180
3181            // Adjust older deltas if necessary
3182            if (shouldAdjustOldDeltas(orgEvent, absDelta)) {
3183                lowestDelta /= 40;
3184            }
3185        }
3186
3187        // Adjust older deltas if necessary
3188        if (shouldAdjustOldDeltas(orgEvent, absDelta)) {
3189            // Divide all the things by 40!
3190            delta /= 40;
3191            deltaX /= 40;
3192            deltaY /= 40;
3193        }
3194
3195        // Get a whole, normalized value for the deltas
3196        delta = Math[delta >= 1 ? 'floor' : 'ceil'](delta / lowestDelta);
3197        deltaX = Math[deltaX >= 1 ? 'floor' : 'ceil'](deltaX / lowestDelta);
3198        deltaY = Math[deltaY >= 1 ? 'floor' : 'ceil'](deltaY / lowestDelta);
3199
3200        // Normalise offsetX and offsetY properties
3201        if (special.settings.normalizeOffset && this.getBoundingClientRect
vendor: 1,935 bytes, lines 3201-3246
3201) {
3202            var boundingRect = this.getBoundingClientRect();
3203            offsetX = event.clientX - boundingRect.left;
3204            offsetY = event.clientY - boundingRect.top;
3205        }
3206
3207        // Add information to the event object
3208        event.deltaX = deltaX;
3209        event.deltaY = deltaY;
3210        event.deltaFactor = lowestDelta;
3211        event.offsetX = offsetX;
3212        event.offsetY = offsetY;
3213        // Go ahead and set deltaMode to 0 since we converted to pixels
3214        // Although this is a little odd since we overwrite the deltaX/Y
3215        // properties with normalized deltas.
3216        event.deltaMode = 0;
3217
3218        // Add event and delta to the front of the arguments
3219        args.unshift(event, delta, deltaX, deltaY);
3220
3221        // Clearout lowestDelta after sometime to better
3222        // handle multiple device types that give different
3223        // a different lowestDelta
3224        // Ex: trackpad = 3 and mouse wheel = 120
3225        if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); }
3226        nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200);
3227
3228        return ($.event.dispatch || $.event.handle).apply(this, args);
3229    }
3230
3231    function nullLowestDelta() {
3232        lowestDelta = null;
3233    }
3234
3235    function shouldAdjustOldDeltas(orgEvent, absDelta) {
3236        // If this is an older event and the delta is divisable by 120,
3237        // then we are assuming that the browser is treating this as an
3238        // older mouse wheel event and that we should divide the deltas
3239        // by 40 to try and get a more usable deltaFactor.
3240        // Side note, this actually impacts the reported scroll distance
3241        // in older browsers and can cause scrolling to be slower than native.
3242        // Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false.
3243        return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0;
3244    }
3245
3246}));

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.