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