PageSourceSearch

https://plastex.uz/era_cms_assets/plugins/datetimepicker/jquery.datetimepicker.full.js

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

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.