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