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