1/** 2 * @preserve jQuery DateTimePicker 3 * @homepage http://xdsoft.net/jqplugins/datetimepicker/ 4 * @author Chupurnov Valeriy (<[email protected]>) 5 */ 6 7/** 8 * @param {jQuery} $ 9 */ 10var datetimepickerFactory = function ($) { 11 'use strict'; 12 13 var default_options = { 14 i18n: { 15 ar: { // Arabic 16 months: [ 17 "ÙØ§ÙÙÙ Ø§ÙØ«Ø§ÙÙ", "شباط", "آذار", "ÙÙØ³Ø§Ù", "٠اÙÙ", "ØØ²ÙراÙ", "ØªÙ ÙØ²", "آب", "Ø£ÙÙÙÙ", "تشرÙÙ Ø§ÙØ£ÙÙ", "تشرÙÙ Ø§ÙØ«Ø§ÙÙ", "ÙØ§ÙÙÙ Ø§ÙØ£ÙÙ" 18 ], 19 dayOfWeekShort: [ 20 "Ù", "Ø«", "ع", "Ø®", "ج", "س", "Ø" 21 ], 22 dayOfWeek: ["Ø§ÙØ£ØØ¯", "Ø§ÙØ§Ø«ÙÙÙ", "Ø§ÙØ«Ùاثاء", "Ø§ÙØ£Ø±Ø¨Ø¹Ø§Ø¡", "Ø§ÙØ®Ù ÙØ³", "Ø§ÙØ¬Ù عة", "Ø§ÙØ³Ø¨Øª", "Ø§ÙØ£ØØ¯"] 23 }, 24 ro: { // Romanian 25 months: [ 26 "Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie" 27 ], 28 dayOfWeekShort: [ 29 "Du", "Lu", "Ma", "Mi", "Jo", "Vi", "Sâ" 30 ], 31 dayOfWeek: ["DuminicÄ", "Luni", "MarÅ£i", "Miercuri", "Joi", "Vineri", "SâmbÄtÄ"] 32 }, 33 id: { // Indonesian 34 months: [ 35 "Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember" 36 ], 37 dayOfWeekShort: [ 38 "Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab" 39 ], 40 dayOfWeek: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"] 41 }, 42 is: { // Icelandic 43 months: [ 44 "Janúar", "Febrúar", "Mars", "AprÃl", "MaÃ", "JúnÃ", "JúlÃ", "Ãgúst", "September", "Október", "Nóvember", "Desember" 45 ], 46 dayOfWeekShort: [ 47 "Sun", "Mán", "Ãrið", "Mið", "Fim", "Fös", "Lau" 48 ], 49 dayOfWeek: ["Sunnudagur", "Mánudagur", "Ãriðjudagur", "Miðvikudagur", "Fimmtudagur", "Föstudagur", "Laugardagur"] 50 }, 51 bg: { // Bulgarian 52 months: [ 53 "ЯнÑаÑи", "ФевÑÑаÑи", "ÐаÑÑ", "ÐпÑил", "Ðай", "Юни", "Юли", "ÐвгÑÑÑ", "СепÑемвÑи", "ÐкÑомвÑи", "ÐоемвÑи", "ÐекемвÑи" 54 ], 55 dayOfWeekShort: [ 56 "Ðд", "Ðн", "ÐÑ", "СÑ", "ЧÑ", "ÐÑ", "Сб" 57 ], 58 dayOfWeek: ["ÐеделÑ", "Ðонеделник", "ÐÑоÑник", "СÑÑда", "ЧеÑвÑÑÑÑк", "ÐеÑÑк", "СÑбоÑа"] 59 }, 60 fa: { // Persian/Farsi 61 months: [ 62 'ÙØ±ÙردÛÙ', 'Ø§Ø±Ø¯ÛØ¨Ùشت', 'خرداد', 'ØªÛØ±', '٠رداد', 'Ø´ÙØ±ÛÙØ±', 'Ù ÙØ±', 'آباÙ', 'آذر', 'دÛ', 'بÙÙ Ù', 'اسÙÙØ¯' 63 ], 64 dayOfWeekShort: [ 65 'ÛÚ©Ø´ÙØ¨Ù', 'Ø¯ÙØ´ÙبÙ', 'Ø³Ù Ø´ÙØ¨Ù', 'ÚÙØ§Ø±Ø´ÙبÙ', 'Ù¾ÙØ¬Ø´ÙبÙ', 'ج٠عÙ', 'Ø´ÙØ¨Ù' 66 ], 67 dayOfWeek: ["ÛÚ©âØ´ÙØ¨Ù", "Ø¯ÙØ´ÙبÙ", "سÙâØ´ÙØ¨Ù", "ÚÙØ§Ø±Ø´ÙبÙ", "Ù¾ÙØ¬âØ´ÙØ¨Ù", "ج٠عÙ", "Ø´ÙØ¨Ù", "ÛÚ©âØ´ÙØ¨Ù"] 68 }, 69 ru: { // Russian 70 months: [ 71 'ЯнваÑÑ', 'ФевÑалÑ', 'ÐаÑÑ', 'ÐпÑелÑ', 'Ðай', 'ÐÑнÑ', 'ÐÑлÑ', 'ÐвгÑÑÑ', 'СенÑÑбÑÑ', 'ÐкÑÑбÑÑ', 'ÐоÑбÑÑ', 'ÐекабÑÑ' 72 ], 73 dayOfWeekShort: [ 74 "ÐÑ", "Ðн", "ÐÑ", "СÑ", "ЧÑ", "ÐÑ", "Сб" 75 ], 76 dayOfWeek: ["ÐоÑкÑеÑенÑе", "ÐонеделÑник", "ÐÑоÑник", "СÑеда", "ЧеÑвеÑг", "ÐÑÑниÑа", "СÑббоÑа"] 77 }, 78 uk: { // Ukrainian 79 months: [ 80 'СÑÑенÑ', 'ÐÑÑий', 'ÐеÑезенÑ', 'ÐвÑÑенÑ', 'ТÑавенÑ', 'ЧеÑвенÑ', 'ÐипенÑ', 'СеÑпенÑ', 'ÐеÑеÑенÑ', 'ÐовÑенÑ', 'ÐиÑÑопад', 'ÐÑÑденÑ' 81 ], 82 dayOfWeekShort: [ 83 "Ðдл", "Ðнд", "ÐÑÑ", "СÑд", "ЧÑв", "ÐÑн", "СбÑ" 84 ], 85 dayOfWeek: ["ÐедÑлÑ", "ÐонедÑлок", "ÐÑвÑоÑок", "СеÑеда", "ЧеÑвеÑ", "Ð'ÑÑниÑÑ", "СÑбоÑа"] 86 }, 87 en: { // English 88 months: [ 89 "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "
89November", "December" 90 ], 91 dayOfWeekShort: [ 92 "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" 93 ], 94 dayOfWeek: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] 95 }, 96 el: { // Îλληνικά 97 months: [ 98 "ÎÎ±Î½Î¿Ï Î¬ÏιοÏ", "ΦεβÏÎ¿Ï Î¬ÏιοÏ", "ÎάÏÏιοÏ", "ÎÏÏίλιοÏ", "ÎάιοÏ", "ÎοÏνιοÏ", "ÎοÏλιοÏ", "ÎÏÎ³Î¿Ï ÏÏοÏ", "ΣεÏÏÎμβÏιοÏ", "ÎκÏÏβÏιοÏ", "ÎοÎμβÏιοÏ", "ÎεκÎμβÏιοÏ" 99 ], 100 dayOfWeekShort: [ 101 "ÎÏ Ï", "ÎÎµÏ ", "ΤÏι", "ΤεÏ", "Πεμ", "ΠαÏ", "Σαβ" 102 ], 103 dayOfWeek: ["ÎÏ Ïιακή", "ÎÎµÏ ÏÎÏα", "ΤÏίÏη", "ΤεÏάÏÏη", "Î ÎμÏÏη", "ΠαÏαÏÎºÎµÏ Î®", "ΣάββαÏο"] 104 }, 105 de: { // German 106 months: [ 107 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember' 108 ], 109 dayOfWeekShort: [ 110 "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa" 111 ], 112 dayOfWeek: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"] 113 }, 114 nl: { // Dutch 115 months: [ 116 "januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december" 117 ], 118 dayOfWeekShort: [ 119 "zo", "ma", "di", "wo", "do", "vr", "za" 120 ], 121 dayOfWeek: ["zondag", "maandag", "dinsdag", "woensdag", "donderdag", "vrijdag", "zaterdag"] 122 }, 123 tr: { // Turkish 124 months: [ 125 "Ocak", "Åubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "AÄustos", "Eylül", "Ekim", "Kasım", "Aralık" 126 ], 127 dayOfWeekShort: [ 128 "Paz", "Pts", "Sal", "Ãar", "Per", "Cum", "Cts" 129 ], 130 dayOfWeek: ["Pazar", "Pazartesi", "Salı", "ÃarÅamba", "PerÅembe", "Cuma", "Cumartesi"] 131 }, 132 fr: { //French 133 months: [ 134 "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre" 135 ], 136 dayOfWeekShort: [ 137 "Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam" 138 ], 139 dayOfWeek: ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"] 140 }, 141 es: { // Spanish 142 months: [ 143 "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre" 144 ], 145 dayOfWeekShort: [ 146 "Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb" 147 ], 148 dayOfWeek: ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"] 149 }, 150 th: { // Thai 151 months: [ 152 'มà¸à¸£à¸²à¸à¸¡', 'à¸à¸¸à¸¡à¸ าà¸à¸±à¸à¸à¹', 'มีà¸à¸²à¸à¸¡', 'à¹à¸¡à¸©à¸²à¸¢à¸', 'à¸à¸¤à¸©à¸ าà¸à¸¡', 'มิà¸à¸¸à¸à¸²à¸¢à¸', 'à¸à¸£à¸à¸à¸²à¸à¸¡', 'สิà¸à¸«à¸²à¸à¸¡', 'à¸à¸±à¸à¸¢à¸²à¸¢à¸', 'à¸à¸¸à¸¥à¸²à¸à¸¡', 'à¸à¸¤à¸¨à¸à¸´à¸à¸²à¸¢à¸', 'à¸à¸±à¸à¸§à¸²à¸à¸¡' 153 ], 154 dayOfWeekShort: [ 155 'à¸à¸².', 'à¸.', 'à¸.', 'à¸.', 'à¸à¸¤.', 'ศ.', 'ส.' 156 ], 157 dayOfWeek: ["à¸à¸²à¸à¸´à¸à¸¢à¹", "à¸à¸±à¸à¸à¸£à¹", "à¸à¸±à¸à¸à¸²à¸£", "à¸à¸¸à¸", "à¸à¸¤à¸«à¸±à¸ª", "ศุà¸à¸£à¹", "à¹à¸ªà¸²à¸£à¹", "à¸à¸²à¸à¸´à¸à¸¢à¹"] 158 }, 159 pl: { // Polish 160 months: [ 161 "styczeÅ", "luty", "marzec", "kwiecieÅ", "maj", "czerwiec", "lipiec", "sierpieÅ", "wrzesieÅ", "październik", "listopad", "grudzieÅ" 162 ], 163 dayOfWeekShort: [ 164 "nd", "pn", "wt", "År", "cz", "pt", "sb" 165 ], 166 dayOfWeek: ["niedziela", "poniedziaÅek", "wtorek", "Åroda", "czwartek", "piÄ tek", "sobota"] 167 }, 168 pt: { // Portuguese 169 months: [ 170 "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro" 171 ], 172 dayOfWeekShort: [ 173 "Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab" 174 ], 175 dayOfWeek: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"] 176 }, 177 ch: { // Simplified Chinese 178 months: [ 179 "䏿", "äºæ", "䏿", "åæ", "äºæ", "å æ", "䏿", "å «æ", "乿", "åæ", "å䏿", "åäºæ" 180 ], 181 dayOfWeekShort: [ 182 "æ¥", "ä¸", "äº", "ä¸", "å", "äº", "å " 183 ] 184 },
185 se: { // Swedish 186 months: [ 187 "Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December" 188 ], 189 dayOfWeekShort: [ 190 "Sön", "MÃ¥n", "Tis", "Ons", "Tor", "Fre", "Lör" 191 ] 192 }, 193 km: { // Khmer (áá¶áá¶ááááá) 194 months: [ 195 "áááá¶â", "áá»áááá", "áá·áá¶â", "áááá¶â", "á§ááá¶â", "áá·áá»áá¶â", "áááááá¶â", "áá¸á á¶â", "ááááá¶â", "áá»áá¶â", "áá·á ááá·áá¶", "áááá¼â" 196 ], 197 dayOfWeekShort: ["á¢á¶áá·â", "á ááááâ", "á¢áááá¶áâ", "áá»áâ", "áááá ââ", "áá»áááâ", "áá áá"], 198 dayOfWeek: ["á¢á¶áá·áááâ", "á ááááâ", "á¢áááá¶áâ", "áá»áâ", "áááá ááááá·áâ", "áá»áááâ", "áá áá"] 199 }, 200 kr: { // Korean 201 months: [ 202 "1ì", "2ì", "3ì", "4ì", "5ì", "6ì", "7ì", "8ì", "9ì", "10ì", "11ì", "12ì" 203 ], 204 dayOfWeekShort: [ 205 "ì¼", "ì", "í", "ì", "목", "ê¸", "í " 206 ], 207 dayOfWeek: ["ì¼ìì¼", "ììì¼", "íìì¼", "ììì¼", "목ìì¼", "ê¸ìì¼", "í ìì¼"] 208 }, 209 it: { // Italian 210 months: [ 211 "Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre" 212 ], 213 dayOfWeekShort: [ 214 "Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab" 215 ], 216 dayOfWeek: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"] 217 }, 218 da: { // Dansk 219 months: [ 220 "Januar", "Februar", "Marts", "April", "Maj", "Juni", "Juli", "August", "September", "Oktober", "November", "December" 221 ], 222 dayOfWeekShort: [ 223 "Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør" 224 ], 225 dayOfWeek: ["søndag", "mandag", "tirsdag", "onsdag", "torsdag", "fredag", "lørdag"] 226 }, 227 no: { // Norwegian 228 months: [ 229 "Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember" 230 ], 231 dayOfWeekShort: [ 232 "Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør" 233 ], 234 dayOfWeek: ['Søndag', 'Mandag', 'Tirsdag', 'Onsdag', 'Torsdag', 'Fredag', 'Lørdag'] 235 }, 236 ja: { // Japanese 237 months: [ 238 "1æ", "2æ", "3æ", "4æ", "5æ", "6æ", "7æ", "8æ", "9æ", "10æ", "11æ", "12æ" 239 ], 240 dayOfWeekShort: [ 241 "æ¥", "æ", "ç«", "æ°´", "æ¨", "é", "å" 242 ], 243 dayOfWeek: ["æ¥æ", "ææ", "ç«æ", "æ°´æ", "æ¨æ", "éæ", "åæ"] 244 }, 245 vi: { // Vietnamese 246 months: [ 247 "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" 248 ], 249 dayOfWeekShort: [ 250 "CN", "T2", "T3", "T4", "T5", "T6", "T7" 251 ], 252 dayOfWeek: ["Chá»§ nháºt", "Thứ hai", "Thứ ba", "Thứ tư", "Thứ nÄm", "Thứ sáu", "Thứ bảy"] 253 }, 254 sl: { // SlovenÅ¡Äina 255 months: [ 256 "Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December" 257 ], 258 dayOfWeekShort: [ 259 "Ned", "Pon", "Tor", "Sre", "Äet", "Pet", "Sob" 260 ], 261 dayOfWeek: ["Nedelja", "Ponedeljek", "Torek", "Sreda", "Äetrtek", "Petek", "Sobota"] 262 }, 263 cs: { // ÄeÅ¡tina 264 months: [ 265 "Leden", "Ãnor", "BÅezen", "Duben", "KvÄten", "Äerven", "Äervenec", "Srpen", "ZáÅÃ", "ÅÃjen", "Listopad", "Prosinec" 266 ], 267 dayOfWeekShort: [ 268 "Ne", "Po", "Ãt", "St", "Ät", "Pá", "So" 269 ] 270 }, 271 hu: { // Hungarian 272 months: [ 273 "Január", "Február", "Március", "Ãprilis", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December" 274 ], 275 dayOfWeekShort: [ 276 "Va", "Hé", "Ke", "Sze", "Cs", "Pé", "Szo" 277 ], 278 dayOfWeek: ["vasárnap", "hétfÅ", "kedd", "szerda", "csütörtök", "péntek", "szombat"] 279 }, 280 az: { //Azerbaijanian (Azeri) 281 months: [ 282 "Yanvar", "Fevral", "Mart", "Aprel", "May", "Iyun", "Iyul", "Avqust", "Sentyabr", "Oktyabr", "Noyabr", "Dekabr" 283 ], 284 dayOfWeekShort: [ 285 "B", "Be", "Ãa", "Ã", "Ca", "C", "Å" 286 ], 287 dayOfWeek: ["Bazar", "Bazar ertÉsi", "ÃÉrÅÉnbÉ axÅamı", "ÃÉrÅÉnbÉ", "CümÉ axÅamı", "CümÉ", "ÅÉnbÉ"] 288 }, 289 bs: { //Bosanski 290 months: [ 291 "Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar" 292 ], 293 dayOfWeekShort: [ 294 "Ned", "Pon", "Uto", "Sri", "Äet", "Pet", "Sub" 295 ], 296 dayOfWeek: ["Nedjelja","Ponedjeljak", "Utorak", "Srijeda", "Äetvrtak", "Petak", "Subota"] 297 }, 298 ca: { //Català 299 months: [ 300 "Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre" 301 ], 302 dayOfWeekShort: [ 303 "Dg", "Dl", "Dt", "Dc", "Dj", "Dv", "Ds" 304 ], 305 dayOfWeek: ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"] 306 }, 307 'en-GB': { //English (British) 308 months: [ 309 "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "
309November", "December" 310 ], 311 dayOfWeekShort: [ 312 "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" 313 ], 314 dayOfWeek: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] 315 }, 316 et: { //"Eesti" 317 months: [ 318 "Jaanuar", "Veebruar", "Märts", "Aprill", "Mai", "Juuni", "Juuli", "August", "September", "Oktoober", "November", "Detsember" 319 ], 320 dayOfWeekShort: [ 321 "P", "E", "T", "K", "N", "R", "L" 322 ], 323 dayOfWeek: ["Pühapäev", "Esmaspäev", "Teisipäev", "Kolmapäev", "Neljapäev", "Reede", "Laupäev"] 324 }, 325 eu: { //Euskara 326 months: [ 327 "Urtarrila", "Otsaila", "Martxoa", "Apirila", "Maiatza", "Ekaina", "Uztaila", "Abuztua", "Iraila", "Urria", "Azaroa", "Abendua" 328 ], 329 dayOfWeekShort: [ 330 "Ig.", "Al.", "Ar.", "Az.", "Og.", "Or.", "La." 331 ], 332 dayOfWeek: ['Igandea', 'Astelehena', 'Asteartea', 'Asteazkena', 'Osteguna', 'Ostirala', 'Larunbata'] 333 }, 334 fi: { //Finnish (Suomi) 335 months: [ 336 "Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu" 337 ], 338 dayOfWeekShort: [ 339 "Su", "Ma", "Ti", "Ke", "To", "Pe", "La" 340 ], 341 dayOfWeek: ["sunnuntai", "maanantai", "tiistai", "keskiviikko", "torstai", "perjantai", "lauantai"] 342 }, 343 gl: { //Galego 344 months: [ 345 "Xan", "Feb", "Maz", "Abr", "Mai", "Xun", "Xul", "Ago", "Set", "Out", "Nov", "Dec" 346 ], 347 dayOfWeekShort: [ 348 "Dom", "Lun", "Mar", "Mer", "Xov", "Ven", "Sab" 349 ], 350 dayOfWeek: ["Domingo", "Luns", "Martes", "Mércores", "Xoves", "Venres", "Sábado"] 351 }, 352 hr: { //Hrvatski 353 months: [ 354 "SijeÄanj", "VeljaÄa", "Ožujak", "Travanj", "Svibanj", "Lipanj", "Srpanj", "Kolovoz", "Rujan", "Listopad", "Studeni", "Prosinac" 355 ], 356 dayOfWeekShort: [ 357 "Ned", "Pon", "Uto", "Sri", "Äet", "Pet", "Sub" 358 ], 359 dayOfWeek: ["Nedjelja", "Ponedjeljak", "Utorak", "Srijeda", "Äetvrtak", "Petak", "Subota"] 360 }, 361 ko: { //Korean (íêµì´) 362 months: [ 363 "1ì", "2ì", "3ì", "4ì", "5ì", "6ì", "7ì", "8ì", "9ì", "10ì", "11ì", "12ì" 364 ], 365 dayOfWeekShort: [ 366 "ì¼", "ì", "í", "ì", "목", "ê¸", "í " 367 ], 368 dayOfWeek: ["ì¼ìì¼", "ììì¼", "íìì¼", "ììì¼", "목ìì¼", "ê¸ìì¼", "í ìì¼"] 369 }, 370 lt: { //Lithuanian (lietuvių) 371 months: [ 372 "Sausio", "Vasario", "Kovo", "Balandžio", "GegužÄs", "Birželio", "Liepos", "RugpjÅ«Äio", "RugsÄjo", "Spalio", "LapkriÄio", "Gruodžio" 373 ], 374 dayOfWeekShort: [ 375 "Sek", "Pir", "Ant", "Tre", "Ket", "Pen", "Å eÅ¡" 376 ], 377 dayOfWeek: ["Sekmadienis", "Pirmadienis", "Antradienis", "TreÄiadienis", "Ketvirtadienis", "Penktadienis", "Å eÅ¡tadienis"] 378 }, 379 lv: { //Latvian (LatvieÅ¡u) 380 months: [ 381 "JanvÄris", "FebruÄris", "Marts", "AprÄ«lis ", "Maijs", "JÅ«nijs", "JÅ«lijs", "Augusts", "Septembris", "Oktobris", "Novembris", "Decembris" 382 ], 383 dayOfWeekShort: [ 384 "Sv", "Pr", "Ot", "Tr", "Ct", "Pk", "St" 385 ], 386 dayOfWeek: ["SvÄtdiena", "Pirmdiena", "Otrdiena", "TreÅ¡diena", "Ceturtdiena", "Piektdiena", "Sestdiena"] 387 }, 388 mk: { //Macedonian (ÐакедонÑки) 389 months: [ 390 "ÑанÑаÑи", "ÑевÑÑаÑи", "маÑÑ", "апÑил", "маÑ", "ÑÑни", "ÑÑли", "авгÑÑÑ", "ÑепÑемвÑи", "окÑомвÑи", "ноемвÑи", "декемвÑи" 391 ], 392 dayOfWeekShort: [ 393 "нед", "пон", "вÑо", "ÑÑе", "ÑеÑ", "пеÑ", "Ñаб" 394 ], 395 dayOfWeek: ["Ðедела", "Ðонеделник", "ÐÑоÑник", "СÑеда", "ЧеÑвÑÑок", "ÐеÑок", "СабоÑа"] 396 }, 397 mn: { //Mongolian (Ðонгол) 398 months: [ 399 "1-Ñ ÑаÑ", "2-Ñ ÑаÑ", "3-Ñ ÑаÑ", "4-Ñ ÑаÑ", "5-Ñ ÑаÑ", "6-Ñ ÑаÑ", "7-Ñ ÑаÑ", "8-Ñ ÑаÑ", "9-Ñ ÑаÑ", "10-Ñ ÑаÑ", "11-Ñ ÑаÑ", "12-Ñ ÑаÑ" 400 ], 401 dayOfWeekShort: [ 402 "Ðав", "ÐÑг", "ÐÑ Ð°", "ÐÒ¯Ñ", "ÐÑн", "ÐÑм", "ÐÑм" 403 ], 404 dayOfWeek: ["Ðаваа", "ÐÑгмаÑ", "ÐÑ Ð°Ð³Ð²Ð°", "ÐÒ¯ÑÑв", "ÐааÑан", "ÐÑмба", "ÐÑм"] 405 }, 406 'pt-BR': { //Português(Brasil) 407 months: [ 408 "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro" 409 ], 410 dayOfWeekShort: [ 411 "Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb" 412 ], 413 dayOfWeek: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "SÃ
413¡bado"] 414 }, 415 sk: { //SlovenÄina 416 months: [ 417 "Január", "Február", "Marec", "AprÃl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December" 418 ], 419 dayOfWeekShort: [ 420 "Ne", "Po", "Ut", "St", "Å t", "Pi", "So" 421 ], 422 dayOfWeek: ["Nedeľa", "Pondelok", "Utorok", "Streda", "Å tvrtok", "Piatok", "Sobota"] 423 }, 424 sq: { //Albanian (Shqip) 425 months: [ 426 "Janar", "Shkurt", "Mars", "Prill", "Maj", "Qershor", "Korrik", "Gusht", "Shtator", "Tetor", "Nëntor", "Dhjetor" 427 ], 428 dayOfWeekShort: [ 429 "Die", "Hën", "Mar", "Mër", "Enj", "Pre", "Shtu" 430 ], 431 dayOfWeek: ["E Diel", "E Hënë", "E MartÄ", "E Mërkurë", "E Enjte", "E Premte", "E Shtunë"] 432 }, 433 'sr-YU': { //Serbian (Srpski) 434 months: [ 435 "Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar" 436 ], 437 dayOfWeekShort: [ 438 "Ned", "Pon", "Uto", "Sre", "Äet", "Pet", "Sub" 439 ], 440 dayOfWeek: ["Nedelja","Ponedeljak", "Utorak", "Sreda", "Äetvrtak", "Petak", "Subota"] 441 }, 442 sr: { //Serbian Cyrillic (СÑпÑки) 443 months: [ 444 "ÑанÑаÑ", "ÑебÑÑаÑ", "маÑÑ", "апÑил", "маÑ", "ÑÑн", "ÑÑл", "авгÑÑÑ", "ÑепÑембаÑ", "окÑобаÑ", "новембаÑ", "деÑембаÑ" 445 ], 446 dayOfWeekShort: [ 447 "нед", "пон", "ÑÑо", "ÑÑе", "ÑеÑ", "пеÑ", "ÑÑб" 448 ], 449 dayOfWeek: ["ÐедеÑа","ÐонедеÑак", "УÑоÑак", "СÑеда", "ЧеÑвÑÑак", "ÐеÑак", "СÑбоÑа"] 450 }, 451 sv: { //Svenska 452 months: [ 453 "Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December" 454 ], 455 dayOfWeekShort: [ 456 "Sön", "MÃ¥n", "Tis", "Ons", "Tor", "Fre", "Lör" 457 ], 458 dayOfWeek: ["Söndag", "MÃ¥ndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"] 459 }, 460 'zh-TW': { //Traditional Chinese (ç¹é«ä¸æ) 461 months: [ 462 "䏿", "äºæ", "䏿", "åæ", "äºæ", "å æ", "䏿", "å «æ", "乿", "åæ", "å䏿", "åäºæ" 463 ], 464 dayOfWeekShort: [ 465 "æ¥", "ä¸", "äº", "ä¸", "å", "äº", "å " 466 ], 467 dayOfWeek: ["æææ¥", "ææä¸", "ææäº", "ææä¸", "ææå", "ææäº", "ææå "] 468 }, 469 zh: { //Simplified Chinese (ç®ä½ä¸æ) 470 months: [ 471 "䏿", "äºæ", "䏿", "åæ", "äºæ", "å æ", "䏿", "å «æ", "乿", "åæ", "å䏿", "åäºæ" 472 ], 473 dayOfWeekShort: [ 474 "æ¥", "ä¸", "äº", "ä¸", "å", "äº", "å " 475 ], 476 dayOfWeek: ["æææ¥", "ææä¸", "ææäº", "ææä¸", "ææå", "ææäº", "ææå "] 477 }, 478 ug:{ // Uyghur(ئÛÙØºÛرÚÛ) 479 months: [ 480 "1-ئاÙ","2-ئاÙ","3-ئاÙ","4-ئاÙ","5-ئاÙ","6-ئاÙ","7-ئاÙ","8-ئاÙ","9-ئاÙ","10-ئاÙ","11-ئاÙ","12-ئاÙ" 481 ], 482 dayOfWeek: [ 483 "ÙÛÙØ´ÛÙØ¨Û", "Ø¯ÛØ´ÛÙØ¨Û","سÛÙØ´ÛÙØ¨Û","ÚØ§Ø±Ø´ÛÙØ¨Û","Ù¾ÛÙØ´ÛÙØ¨Û","جÛÙ Û","Ø´ÛÙØ¨Û" 484 ] 485 }, 486 he: { //Hebrew (×¢×ר×ת) 487 months: [ 488 '×× ××ר', 'פ×ר××ר', '×רץ', '×פר××', '×××', '××× ×', '××××', '××××ס×', 'ספ×××ר', '×××§×××ר', '× ××××ר', '×צ××ר' 489 ], 490 dayOfWeekShort: [ 491 '×\'', '×\'', '×\'', '×\'', '×\'', '×\'', 'ש×ת' 492 ], 493 dayOfWeek: ["ר×ש××", "×©× ×", "ש××ש×", "ר×××¢×", "×××ש×", "ש×ש×", "ש×ת", "ר×ש××"] 494 }, 495 hy: { // Armenian 496 months: [ 497 "ÕÕ¸ÖÕ¶Õ¾Õ¡Ö", "ÕÕ¥Õ¿ÖÕ¾Õ¡Ö", "ÕÕ¡ÖÕ¿", "Ô±ÕºÖÕ«Õ¬", "ÕÕ¡ÕµÕ«Õ½", "ÕÕ¸ÖÕ¶Õ«Õ½", "ÕÕ¸ÖÕ¬Õ«Õ½", "ÕÕ£Õ¸Õ½Õ¿Õ¸Õ½", "ÕÕ¥ÕºÕ¿Õ¥Õ´Õ¢Õ¥Ö", "ÕÕ¸Õ¯Õ¿Õ¥Õ´Õ¢Õ¥Ö", "ÕÕ¸ÕµÕ¥Õ´Õ¢Õ¥Ö", "Ô´Õ¥Õ¯Õ¿Õ¥Õ´Õ¢Õ¥Ö" 498 ], 499 dayOfWeekShort: [ 500 "Ô¿Õ«", "ÔµÖÕ¯", "ÔµÖÖ", "ÕÕ¸Ö", "ÕÕ¶Õ£", "ÕÖÖÕ¢", "ÕÕ¢Õ©" 501 ], 502 dayOfWeek: ["Ô¿Õ«ÖÕ¡Õ¯Õ«", "ÔµÖÕ¯Õ¸ÖÕ·Õ¡Õ¢Õ©Õ«", "ÔµÖÕ¥ÖÕ·Õ¡Õ¢Õ©Õ«", "ÕÕ¸ÖÕ¥ÖÕ·Õ¡Õ¢Õ©Õ«", "ÕÕ«Õ¶Õ£Õ·Õ¡Õ¢Õ©Õ«", "ÕÖÖÕ¢Õ¡Õ©", "ÕÕ¡Õ¢Õ¡Õ©"] 503 }, 504 kg: { // Kyrgyz 505 months: [
vendor: 11,897 bytes, lines 506-894
506 'Ò®ÑÑүн айÑ', 'ÐиÑдин айÑ', 'Ðалган ÐÑÑан', 'ЧÑн ÐÑÑан', 'ÐÑгÑ', 'ÐÑлжа', 'Теке', 'ÐÐ°Ñ Ðона', 'ÐÑк Ðона', 'ТогÑздÑн айÑ', 'ÐеÑинин айÑ', 'ÐеÑÑин айÑ' 507 ], 508 dayOfWeekShort: [ 509 "Ðек", "Ðүй", "Шей", "ШаÑ", "Ðей", "ÐÑм", "ÐÑе" 510 ], 511 dayOfWeek: [ 512 "ÐекÑемб", "ÐүйÑөмб", "ШейÑемб", "ШаÑÑемб", "ÐейÑемби", "ÐÑма", "ÐÑенб" 513 ] 514 }, 515 rm: { // Romansh 516 months: [ 517 "Schaner", "Favrer", "Mars", "Avrigl", "Matg", "Zercladur", "Fanadur", "Avust", "Settember", "October", "November", "December" 518 ], 519 dayOfWeekShort: [ 520 "Du", "Gli", "Ma", "Me", "Gie", "Ve", "So" 521 ], 522 dayOfWeek: [ 523 "Dumengia", "Glindesdi", "Mardi", "Mesemna", "Gievgia", "Venderdi", "Sonda" 524 ] 525 }, 526 ka: { // Georgian 527 months: [ 528 'áááááá á', 'ááááá áááá', 'ááá á¢á', 'ááá ááá', 'áááá¡á', 'ááááá¡á', 'ááááá¡á', 'ááááá¡á¢á', 'á¡áá¥á¢ááááá á', 'áá¥á¢ááááá á', 'ááááááá á', 'áááááááá á' 529 ], 530 dayOfWeekShort: [ 531 "áá", "áá á¨", "á¡ááá¨", "ááá®", "á®á£á", "ááá ", "á¨áá" 532 ], 533 dayOfWeek: ["áááá á", "áá á¨ááááá", "á¡ááá¨ááááá", "ááá®á¨ááááá", "á®á£áá¨ááááá", "ááá áá¡áááá", "á¨ááááá"] 534 } 535 }, 536 537 ownerDocument: document, 538 contentWindow: window, 539 540 value: '', 541 rtl: false, 542 543 format: 'Y/m/d H:i', 544 formatTime: 'H:i', 545 formatDate: 'Y/m/d', 546 547 startDate: false, // new Date(), '1986/12/08', '-1970/01/05','-1970/01/05', 548 step: 60, 549 monthChangeSpinner: true, 550 551 closeOnDateSelect: false, 552 closeOnTimeSelect: true, 553 closeOnWithoutClick: true, 554 closeOnInputClick: true, 555 openOnFocus: true, 556 557 timepicker: true, 558 datepicker: true, 559 weeks: false, 560 561 defaultTime: false, // use formatTime format (ex. '10:00' for formatTime: 'H:i') 562 defaultDate: false, // use formatDate format (ex new Date() or '1986/12/08' or '-1970/01/05' or '-1970/01/05') 563 564 minDate: false, 565 maxDate: false, 566 minTime: false, 567 maxTime: false, 568 minDateTime: false, 569 maxDateTime: false, 570 571 allowTimes: [], 572 opened: false, 573 initTime: true, 574 inline: false, 575 theme: '', 576 touchMovedThreshold: 5, 577 578 onSelectDate: function () {}, 579 onSelectTime: function () {}, 580 onChangeMonth: function () {}, 581 onGetWeekOfYear: function () {}, 582 onChangeYear: function () {}, 583 onChangeDateTime: function () {}, 584 onShow: function () {}, 585 onClose: function () {}, 586 onGenerate: function () {}, 587 588 withoutCopyright: true, 589 inverseButton: false, 590 hours12: false, 591 next: 'xdsoft_next', 592 prev : 'xdsoft_prev', 593 dayOfWeekStart: 0, 594 parentID: 'body', 595 timeHeightInTimePicker: 25, 596 timepickerScrollbar: true, 597 todayButton: true, 598 prevButton: true, 599 nextButton: true, 600 defaultSelect: true, 601 602 scrollMonth: true, 603 scrollTime: true, 604 scrollInput: true, 605 606 lazyInit: false, 607 mask: false, 608 validateOnBlur: true, 609 allowBlank: true, 610 yearStart: 1950, 611 yearEnd: 2050, 612 monthStart: 0, 613 monthEnd: 11, 614 style: '', 615 id: '', 616 fixed: false, 617 roundTime: 'round', // ceil, floor 618 className: '', 619 weekends: [], 620 highlightedDates: [], 621 highlightedPeriods: [], 622 allowDates : [], 623 allowDateRe : null, 624 disabledDates : [], 625 disabledWeekDays: [], 626 yearOffset: 0, 627 beforeShowDay: null, 628 629 enterLikeTab: true, 630 showApplyButton: false 631 }; 632 633 var dateHelper = null, 634 defaultDateHelper = null, 635 globalLocaleDefault = 'en', 636 globalLocale = 'en'; 637 638 var dateFormatterOptionsDefault = { 639 meridiem: ['AM', 'PM'] 640 }; 641 642 var initDateFormatter = function(){ 643 var locale = default_options.i18n[globalLocale], 644 opts = { 645 days: locale.dayOfWeek, 646 daysShort: locale.dayOfWeekShort, 647 months: locale.months, 648 monthsShort: $.map(locale.months, function(n){ return n.substring(0, 3) }) 649 }; 650 651 if (typeof DateFormatter === 'function') { 652 dateHelper = defaultDateHelper = new DateFormatter({ 653 dateSettings: $.extend({}, dateFormatterOptionsDefault, opts) 654 }); 655 } 656 }; 657 658 var dateFormatters = { 659 moment: { 660 default_options:{ 661 format: 'YYYY/MM/DD HH:mm', 662 formatDate: 'YYYY/MM/DD', 663 formatTime: 'HH:mm', 664 }, 665 formatter: { 666 parseDate: function (date, format) { 667 if(isFormatStandard(format)){ 668 return defaultDateHelper.parseDate(date, format); 669 } 670 var d = moment(date, format); 671 return d.isValid() ? d.toDate() : false; 672 }, 673 674 formatDate: function (date, format) { 675 if(isFormatStandard(format)){ 676 return defaultDateHelper.formatDate(date, format); 677 } 678 return moment(date).format(format); 679 }, 680 681 formatMask: function(format){ 682 return format 683 .replace(/Y{4}/g, '9999') 684 .replace(/Y{2}/g, '99') 685 .replace(/M{2}/g, '19') 686 .replace(/D{2}/g, '39') 687 .replace(/H{2}/g, '29') 688 .replace(/m{2}/g, '59') 689 .replace(/s{2}/g, '59'); 690 }, 691 } 692 } 693 } 694 695 // for locale settings 696 $.datetimepicker = { 697 setLocale: function(locale){ 698 var newLocale = default_options.i18n[locale] ? locale : globalLocaleDefault; 699 if (globalLocale !== newLocale) { 700 globalLocale = newLocale; 701 // reinit date formatter 702 initDateFormatter(); 703 } 704 }, 705 706 setDateFormatter: function(dateFormatter) { 707 if(typeof dateFormatter === 'string' && dateFormatters.hasOwnProperty(dateFormatter)){ 708 var df = dateFormatters[dateFormatter]; 709 $.extend(default_options, df.default_options); 710 dateHelper = df.formatter; 711 } 712 else { 713 dateHelper = dateFormatter; 714 } 715 }, 716 }; 717 718 var standardFormats = { 719 RFC_2822: 'D, d M Y H:i:s O', 720 ATOM: 'Y-m-d\TH:i:sP', 721 ISO_8601: 'Y-m-d\TH:i:sO', 722 RFC_822: 'D, d M y H:i:s O', 723 RFC_850: 'l, d-M-y H:i:s T', 724 RFC_1036: 'D, d M y H:i:s O', 725 RFC_1123: 'D, d M Y H:i:s O', 726 RSS: 'D, d M Y H:i:s O', 727 W3C: 'Y-m-d\TH:i:sP' 728 } 729 730 var isFormatStandard = function(format){ 731 return $.map(standardFormats, function (val) { return val }) 732 .indexOf(format) === -1 ? false : true; 733 } 734 735 $.extend($.datetimepicker, standardFormats); 736 737 // first init date formatter 738 initDateFormatter(); 739 740 // fix for ie8 741 if (!window.getComputedStyle) { 742 window.getComputedStyle = function (el) { 743 this.el = el; 744 this.getPropertyValue = function (prop) { 745 var re = /(-([a-z]))/g; 746 if (prop === 'float') { 747 prop = 'styleFloat'; 748 } 749 if (re.test(prop)) { 750 prop = prop.replace(re, function (a, b, c) { 751 return c.toUpperCase(); 752 }); 753 } 754 return el.currentStyle[prop] || null; 755 }; 756 return this; 757 }; 758 } 759 if (!Array.prototype.indexOf) { 760 Array.prototype.indexOf = function (obj, start) { 761 var i, j; 762 for (i = (start || 0), j = this.length; i < j; i += 1) { 763 if (this[i] === obj) { return i; } 764 } 765 return -1; 766 }; 767 } 768 769 Date.prototype.countDaysInMonth = function () { 770 return new Date(this.getFullYear(), this.getMonth() + 1, 0).getDate(); 771 }; 772 773 $.fn.xdsoftScroller = function (options, percent) { 774 return this.each(function () { 775 var timeboxparent = $(this), 776 pointerEventToXY = function (e) { 777 var out = {x: 0, y: 0}, 778 touch; 779 if (e.type === 'touchstart' || e.type === 'touchmove' || e.type === 'touchend' || e.type === 'touchcancel') { 780 touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0]; 781 out.x = touch.clientX; 782 out.y = touch.clientY; 783 } else if (e.type === 'mousedown' || e.type === 'mouseup' || e.type === 'mousemove' || e.type === 'mouseover' || e.type === 'mouseout' || e.type === 'mouseenter' || e.type === 'mouseleave') { 784 out.x = e.clientX; 785 out.y = e.clientY; 786 } 787 return out; 788 }, 789 timebox, 790 parentHeight, 791 height, 792 scrollbar, 793 scroller, 794 maximumOffset = 100, 795 start = false, 796 startY = 0, 797 startTop = 0, 798 h1 = 0, 799 touchStart = false, 800 startTopScroll = 0, 801 calcOffset = function () {}; 802 803 if (percent === 'hide') { 804 timeboxparent.find('.xdsoft_scrollbar').hide(); 805 return; 806 } 807 808 if (!$(this).hasClass('xdsoft_scroller_box')) { 809 timebox = timeboxparent.children().eq(0); 810 parentHeight = timeboxparent[0].clientHeight; 811 height = timebox[0].offsetHeight; 812 scrollbar = $('<div class="xdsoft_scrollbar"></div>'); 813 scroller = $('<div class="xdsoft_scroller"></div>'); 814 scrollbar.append(scroller); 815 816 timeboxparent.addClass('xdsoft_scroller_box').append(scrollbar); 817 calcOffset = function calcOffset(event) { 818 var offset = pointerEventToXY(event).y - startY + startTopScroll; 819 if (offset < 0) { 820 offset = 0; 821 } 822 if (offset + scroller[0].offsetHeight > h1) { 823 offset = h1 - scroller[0].offsetHeight; 824 } 825 timeboxparent.trigger('scroll_element.xdsoft_scroller', [maximumOffset ? offset / maximumOffset : 0]); 826 }; 827 828 scroller 829 .on('touchstart.xdsoft_scroller mousedown.xdsoft_scroller', function (event) { 830 if (!parentHeight) { 831 timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percent]); 832 } 833 834 startY = pointerEventToXY(event).y; 835 startTopScroll = parseInt(scroller.css('margin-top'), 10); 836 h1 = scrollbar[0].offsetHeight; 837 838 if (event.type === 'mousedown' || event.type === 'touchstart') { 839 if (options.ownerDocument) { 840 $(options.ownerDocument.body).addClass('xdsoft_noselect'); 841 } 842 $([options.ownerDocument.body, options.contentWindow]).on('touchend mouseup.xdsoft_scroller', function arguments_callee() { 843 $([options.ownerDocument.body, options.contentWindow]).off('touchend mouseup.xdsoft_scroller', arguments_callee) 844 .off('mousemove.xdsoft_scroller', calcOffset) 845 .removeClass('xdsoft_noselect'); 846 }); 847 $(options.ownerDocument.body).on('mousemove.xdsoft_scroller', calcOffset); 848 } else { 849 touchStart = true; 850 event.stopPropagation(); 851 event.preventDefault(); 852 } 853 }) 854 .on('touchmove', function (event) { 855 if (touchStart) { 856 event.preventDefault(); 857 calcOffset(event); 858 } 859 }) 860 .on('touchend touchcancel', function () { 861 touchStart = false; 862 startTopScroll = 0; 863 }); 864 865 timeboxparent 866 .on('scroll_element.xdsoft_scroller', function (event, percentage) { 867 if (!parentHeight) { 868 timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percentage, true]); 869 } 870 percentage = percentage > 1 ? 1 : (percentage < 0 || isNaN(percentage)) ? 0 : percentage; 871 872 scroller.css('margin-top', maximumOffset * percentage); 873 874 setTimeout(function () { 875 timebox.css('marginTop', -parseInt((timebox[0].offsetHeight - parentHeight) * percentage, 10)); 876 }, 10); 877 }) 878 .on('resize_scroll.xdsoft_scroller', function (event, percentage, noTriggerScroll) { 879 var percent, sh; 880 parentHeight = timeboxparent[0].clientHeight; 881 height = timebox[0].offsetHeight; 882 percent = parentHeight / height; 883 sh = percent * scrollbar[0].offsetHeight; 884 if (percent > 1) { 885 scroller.hide(); 886 } else { 887 scroller.show(); 888 scroller.css('height', parseInt(sh > 10 ? sh : 10, 10)); 889 maximumOffset = scrollbar[0].offsetHeight - scroller[0].offsetHeight; 890 if (noTriggerScroll !== true) { 891 timeboxparent.trigger('scroll_element.xdsoft_scroller', [percentage || Math.abs(parseInt(timebox.css('marginTop'), 10)) / (height - parentHeight)]); 892 } 893 } 894 });
vendor: 4,323 bytes, lines 895-1022
895 896 timeboxparent.on('mousewheel', function (event) { 897 var top = Math.abs(parseInt(timebox.css('marginTop'), 10)); 898 899 top = top - (event.deltaY * 20); 900 if (top < 0) { 901 top = 0; 902 } 903 904 timeboxparent.trigger('scroll_element.xdsoft_scroller', [top / (height - parentHeight)]); 905 event.stopPropagation(); 906 return false; 907 }); 908 909 timeboxparent.on('touchstart', function (event) { 910 start = pointerEventToXY(event); 911 startTop = Math.abs(parseInt(timebox.css('marginTop'), 10)); 912 }); 913 914 timeboxparent.on('touchmove', function (event) { 915 if (start) { 916 event.preventDefault(); 917 var coord = pointerEventToXY(event); 918 timeboxparent.trigger('scroll_element.xdsoft_scroller', [(startTop - (coord.y - start.y)) / (height - parentHeight)]); 919 } 920 }); 921 922 timeboxparent.on('touchend touchcancel', function () { 923 start = false; 924 startTop = 0; 925 }); 926 } 927 timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percent]); 928 }); 929 }; 930 931 $.fn.datetimepicker = function (opt, opt2) { 932 var result = this, 933 KEY0 = 48, 934 KEY9 = 57, 935 _KEY0 = 96, 936 _KEY9 = 105, 937 CTRLKEY = 17, 938 DEL = 46, 939 ENTER = 13, 940 ESC = 27, 941 BACKSPACE = 8, 942 ARROWLEFT = 37, 943 ARROWUP = 38, 944 ARROWRIGHT = 39, 945 ARROWDOWN = 40, 946 TAB = 9, 947 F5 = 116, 948 AKEY = 65, 949 CKEY = 67, 950 VKEY = 86, 951 ZKEY = 90, 952 YKEY = 89, 953 ctrlDown = false, 954 options = ($.isPlainObject(opt) || !opt) ? $.extend(true, {}, default_options, opt) : $.extend(true, {}, default_options), 955 956 lazyInitTimer = 0, 957 createDateTimePicker, 958 destroyDateTimePicker, 959 960 lazyInit = function (input) { 961 input 962 .on('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', function initOnActionCallback() { 963 if (input.is(':disabled') || input.data('xdsoft_datetimepicker')) { 964 return; 965 } 966 clearTimeout(lazyInitTimer); 967 lazyInitTimer = setTimeout(function () { 968 969 if (!input.data('xdsoft_datetimepicker')) { 970 createDateTimePicker(input); 971 } 972 input 973 .off('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', initOnActionCallback) 974 .trigger('open.xdsoft'); 975 }, 100); 976 }); 977 }; 978 979 createDateTimePicker = function (input) { 980 var datetimepicker = $('<div class="xdsoft_datetimepicker xdsoft_noselect"></div>'), 981 xdsoft_copyright = $('<div class="xdsoft_copyright"><a target="_blank" href="http://xdsoft.net/jqplugins/datetimepicker/">xdsoft.net</a></div>'), 982 datepicker = $('<div class="xdsoft_datepicker active"></div>'), 983 month_picker = $('<div class="xdsoft_monthpicker"><button type="button" class="xdsoft_prev"></button><button type="button" class="xdsoft_today_button"></button>' + 984 '<div class="xdsoft_label xdsoft_month"><span></span><i></i></div>' + 985 '<div class="xdsoft_label xdsoft_year"><span></span><i></i></div>' + 986 '<button type="button" class="xdsoft_next"></button></div>'), 987 calendar = $('<div class="xdsoft_calendar"></div>'), 988 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>'), 989 timeboxparent = timepicker.find('.xdsoft_time_box').eq(0), 990 timebox = $('<div class="xdsoft_time_variant"></div>'), 991 applyButton = $('<button type="button" class="xdsoft_save_selected blue-gradient-button">Save Selected</button>'), 992 993 monthselect = $('<div class="xdsoft_select xdsoft_monthselect"><div></div></div>'), 994 yearselect = $('<div class="xdsoft_select xdsoft_yearselect"><div></div></div>'), 995 triggerAfterOpen = false, 996 XDSoft_datetime, 997 998 xchangeTimer, 999 timerclick, 1000 current_time_index, 1001 setPos, 1002 timer = 0, 1003 _xdsoft_datetime, 1004 forEachAncestorOf; 1005 1006 if (options.id) { 1007 datetimepicker.attr('id', options.id); 1008 } 1009 if (options.style) { 1010 datetimepicker.attr('style', options.style); 1011 } 1012 if (options.weeks) { 1013 datetimepicker.addClass('xdsoft_showweeks'); 1014 } 1015 if (options.rtl) { 1016 datetimepicker.addClass('xdsoft_rtl'); 1017 } 1018 1019 datetimepicker.addClass('xdsoft_' + options.theme); 1020 datetimepicker.addClass(options.className); 1021 1022 month_picker
vendor: 10,033 bytes, lines 1023-1291
1023 .find('.xdsoft_month span') 1024 .after(monthselect); 1025 month_picker 1026 .find('.xdsoft_year span') 1027 .after(yearselect); 1028 1029 month_picker 1030 .find('.xdsoft_month,.xdsoft_year') 1031 .on('touchstart mousedown.xdsoft', function (event) { 1032 var select = $(this).find('.xdsoft_select').eq(0), 1033 val = 0, 1034 top = 0, 1035 visible = select.is(':visible'), 1036 items, 1037 i; 1038 1039 month_picker 1040 .find('.xdsoft_select') 1041 .hide(); 1042 if (_xdsoft_datetime.currentTime) { 1043 val = _xdsoft_datetime.currentTime[$(this).hasClass('xdsoft_month') ? 'getMonth' : 'getFullYear'](); 1044 } 1045 1046 select[visible ? 'hide' : 'show'](); 1047 for (items = select.find('div.xdsoft_option'), i = 0; i < items.length; i += 1) { 1048 if (items.eq(i).data('value') === val) { 1049 break; 1050 } else { 1051 top += items[0].offsetHeight; 1052 } 1053 } 1054 1055 select.xdsoftScroller(options, top / (select.children()[0].offsetHeight - (select[0].clientHeight))); 1056 event.stopPropagation(); 1057 return false; 1058 }); 1059 1060 var handleTouchMoved = function (event) { 1061 var evt = event.originalEvent; 1062 var touchPosition = evt.touches ? evt.touches[0] : evt; 1063 this.touchStartPosition = this.touchStartPosition || touchPosition; 1064 var xMovement = Math.abs(this.touchStartPosition.clientX - touchPosition.clientX); 1065 var yMovement = Math.abs(this.touchStartPosition.clientY - touchPosition.clientY); 1066 var distance = Math.sqrt(xMovement * xMovement + yMovement * yMovement); 1067 if(distance > options.touchMovedThreshold) { 1068 this.touchMoved = true; 1069 } 1070 } 1071 1072 month_picker 1073 .find('.xdsoft_select') 1074 .xdsoftScroller(options) 1075 .on('touchstart mousedown.xdsoft', function (event) { 1076 var evt = event.originalEvent; 1077 this.touchMoved = false; 1078 this.touchStartPosition = evt.touches ? evt.touches[0] : evt; 1079 event.stopPropagation(); 1080 event.preventDefault(); 1081 }) 1082 .on('touchmove', '.xdsoft_option', handleTouchMoved) 1083 .on('touchend mousedown.xdsoft', '.xdsoft_option', function () { 1084 if (!this.touchMoved) { 1085 if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null) { 1086 _xdsoft_datetime.currentTime = _xdsoft_datetime.now(); 1087 } 1088 1089 var year = _xdsoft_datetime.currentTime.getFullYear(); 1090 if (_xdsoft_datetime && _xdsoft_datetime.currentTime) { 1091 _xdsoft_datetime.currentTime[$(this).parent().parent().hasClass('xdsoft_monthselect') ? 'setMonth' : 'setFullYear']($(this).data('value')); 1092 } 1093 1094 $(this).parent().parent().hide(); 1095 1096 datetimepicker.trigger('xchange.xdsoft'); 1097 if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) { 1098 options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); 1099 } 1100 1101 if (year !== _xdsoft_datetime.currentTime.getFullYear() && $.isFunction(options.onChangeYear)) { 1102 options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); 1103 } 1104 } 1105 }); 1106 1107 datetimepicker.getValue = function () { 1108 return _xdsoft_datetime.getCurrentTime(); 1109 }; 1110 1111 datetimepicker.setOptions = function (_options) { 1112 var highlightedDates = {}; 1113 1114 options = $.extend(true, {}, options, _options); 1115 1116 if (_options.allowTimes && $.isArray(_options.allowTimes) && _options.allowTimes.length) { 1117 options.allowTimes = $.extend(true, [], _options.allowTimes); 1118 } 1119 1120 if (_options.weekends && $.isArray(_options.weekends) && _options.weekends.length) { 1121 options.weekends = $.extend(true, [], _options.weekends); 1122 } 1123 1124 if (_options.allowDates && $.isArray(_options.allowDates) && _options.allowDates.length) { 1125 options.allowDates = $.extend(true, [], _options.allowDates); 1126 } 1127 1128 if (_options.allowDateRe && Object.prototype.toString.call(_options.allowDateRe)==="[object String]") { 1129 options.allowDateRe = new RegExp(_options.allowDateRe); 1130 } 1131 1132 if (_options.highlightedDates && $.isArray(_options.highlightedDates) && _options.highlightedDates.length) { 1133 $.each(_options.highlightedDates, function (index, value) { 1134 var splitData = $.map(value.split(','), $.trim), 1135 exDesc, 1136 hDate = new HighlightedDate(dateHelper.parseDate(splitData[0], options.formatDate), splitData[1], splitData[2]), // date, desc, style 1137 keyDate = dateHelper.formatDate(hDate.date, options.formatDate); 1138 if (highlightedDates[keyDate] !== undefined) { 1139 exDesc = highlightedDates[keyDate].desc; 1140 if (exDesc && exDesc.length && hDate.desc && hDate.desc.length) { 1141 highlightedDates[keyDate].desc = exDesc + "\n" + hDate.desc; 1142 } 1143 } else { 1144 highlightedDates[keyDate] = hDate; 1145 } 1146 }); 1147 1148 options.highlightedDates = $.extend(true, [], highlightedDates); 1149 } 1150 1151 if (_options.highlightedPeriods && $.isArray(_options.highlightedPeriods) && _options.highlightedPeriods.length) { 1152 highlightedDates = $.extend(true, [], options.highlightedDates); 1153 $.each(_options.highlightedPeriods, function (index, value) { 1154 var dateTest, // start date 1155 dateEnd, 1156 desc, 1157 hDate, 1158 keyDate, 1159 exDesc, 1160 style; 1161 if ($.isArray(value)) { 1162 dateTest = value[0]; 1163 dateEnd = value[1]; 1164 desc = value[2]; 1165 style = value[3]; 1166 } 1167 else { 1168 var splitData = $.map(value.split(','), $.trim); 1169 dateTest = dateHelper.parseDate(splitData[0], options.formatDate); 1170 dateEnd = dateHelper.parseDate(splitData[1], options.formatDate); 1171 desc = splitData[2]; 1172 style = splitData[3]; 1173 } 1174 1175 while (dateTest <= dateEnd) { 1176 hDate = new HighlightedDate(dateTest, desc, style); 1177 keyDate = dateHelper.formatDate(dateTest, options.formatDate); 1178 dateTest.setDate(dateTest.getDate() + 1); 1179 if (highlightedDates[keyDate] !== undefined) { 1180 exDesc = highlightedDates[keyDate].desc; 1181 if (exDesc && exDesc.length && hDate.desc && hDate.desc.length) { 1182 highlightedDates[keyDate].desc = exDesc + "\n" + hDate.desc; 1183 } 1184 } else { 1185 highlightedDates[keyDate] = hDate; 1186 } 1187 } 1188 }); 1189 1190 options.highlightedDates = $.extend(true, [], highlightedDates); 1191 } 1192 1193 if (_options.disabledDates && $.isArray(_options.disabledDates) && _options.disabledDates.length) { 1194 options.disabledDates = $.extend(true, [], _options.disabledDates); 1195 } 1196 1197 if (_options.disabledWeekDays && $.isArray(_options.disabledWeekDays) && _options.disabledWeekDays.length) { 1198 options.disabledWeekDays = $.extend(true, [], _options.disabledWeekDays); 1199 } 1200 1201 if ((options.open || options.opened) && (!options.inline)) { 1202 input.trigger('open.xdsoft'); 1203 } 1204 1205 if (options.inline) { 1206 triggerAfterOpen = true; 1207 datetimepicker.addClass('xdsoft_inline'); 1208 input.after(datetimepicker).hide(); 1209 } 1210 1211 if (options.inverseButton) { 1212 options.next = 'xdsoft_prev'; 1213 options.prev = 'xdsoft_next'; 1214 } 1215 1216 if (options.datepicker) { 1217 datepicker.addClass('active'); 1218 } else { 1219 datepicker.removeClass('active'); 1220 } 1221 1222 if (options.timepicker) { 1223 timepicker.addClass('active'); 1224 } else { 1225 timepicker.removeClass('active'); 1226 } 1227 1228 if (options.value) { 1229 _xdsoft_datetime.setCurrentTime(options.value); 1230 if (input && input.val) { 1231 input.val(_xdsoft_datetime.str); 1232 } 1233 } 1234 1235 if (isNaN(options.dayOfWeekStart)) { 1236 options.dayOfWeekStart = 0; 1237 } else { 1238 options.dayOfWeekStart = parseInt(options.dayOfWeekStart, 10) % 7; 1239 } 1240 1241 if (!options.timepickerScrollbar) { 1242 timeboxparent.xdsoftScroller(options, 'hide'); 1243 } 1244 1245 if (options.minDate && /^[\+\-](.*)$/.test(options.minDate)) { 1246 options.minDate = dateHelper.formatDate(_xdsoft_datetime.strToDateTime(options.minDate), options.formatDate); 1247 } 1248 1249 if (options.maxDate && /^[\+\-](.*)$/.test(options.maxDate)) { 1250 options.maxDate = dateHelper.formatDate(_xdsoft_datetime.strToDateTime(options.maxDate), options.formatDate); 1251 } 1252 1253 if (options.minDateTime && /^\+(.*)$/.test(options.minDateTime)) { 1254 options.minDateTime = _xdsoft_datetime.strToDateTime(options.minDateTime).dateFormat(options.formatDate); 1255 } 1256 1257 if (options.maxDateTime && /^\+(.*)$/.test(options.maxDateTime)) { 1258 options.maxDateTime = _xdsoft_datetime.strToDateTime(options.maxDateTime).dateFormat(options.formatDate); 1259 } 1260 1261 applyButton.toggle(options.showApplyButton); 1262 1263 month_picker 1264 .find('.xdsoft_today_button') 1265 .css('visibility', !options.todayButton ? 'hidden' : 'visible'); 1266 1267 month_picker 1268 .find('.' + options.prev) 1269 .css('visibility', !options.prevButton ? 'hidden' : 'visible'); 1270 1271 month_picker 1272 .find('.' + options.next) 1273 .css('visibility', !options.nextButton ? 'hidden' : 'visible'); 1274 1275 setMask(options); 1276 1277 if (options.validateOnBlur) { 1278 input 1279 .off('blur.xdsoft') 1280 .on('blur.xdsoft', function () { 1281 if (options.allowBlank && (!$.trim($(this).val()).length || 1282 (typeof options.mask === "string" && $.trim($(this).val()) === options.mask.replace(/[0-9]/g, '_')))) { 1283 $(this).val(null); 1284 datetimepicker.data('xdsoft_datetime').empty(); 1285 } else { 1286 var d = dateHelper.parseDate($(this).val(), options.format); 1287 if (d) { // parseDate() may skip some invalid parts like date or time, so make it clear for user: show parsed date/time 1288 $(this).val(dateHelper.formatDate(d, options.format)); 1289 } else { 1290 var splittedHours = +([$(this).val()[0], $(this).val()[1]].join('')), 1291 splittedMinutes = +([$(this).val()[2], $(this).val()[3]].join(''));
vendor: 4,566 bytes, lines 1292-1449
1292 1293 // parse the numbers as 0312 => 03:12 1294 if (!options.datepicker && options.timepicker && splittedHours >= 0 && splittedHours < 24 && splittedMinutes >= 0 && splittedMinutes < 60) { 1295 $(this).val([splittedHours, splittedMinutes].map(function (item) { 1296 return item > 9 ? item : '0' + item; 1297 }).join(':')); 1298 } else { 1299 $(this).val(dateHelper.formatDate(_xdsoft_datetime.now(), options.format)); 1300 } 1301 } 1302 datetimepicker.data('xdsoft_datetime').setCurrentTime($(this).val()); 1303 } 1304 1305 datetimepicker.trigger('changedatetime.xdsoft'); 1306 datetimepicker.trigger('close.xdsoft'); 1307 }); 1308 } 1309 options.dayOfWeekStartPrev = (options.dayOfWeekStart === 0) ? 6 : options.dayOfWeekStart - 1; 1310 1311 datetimepicker 1312 .trigger('xchange.xdsoft') 1313 .trigger('afterOpen.xdsoft'); 1314 }; 1315 1316 datetimepicker 1317 .data('options', options) 1318 .on('touchstart mousedown.xdsoft', function (event) { 1319 event.stopPropagation(); 1320 event.preventDefault(); 1321 yearselect.hide(); 1322 monthselect.hide(); 1323 return false; 1324 }); 1325 1326 //scroll_element = timepicker.find('.xdsoft_time_box'); 1327 timeboxparent.append(timebox); 1328 timeboxparent.xdsoftScroller(options); 1329 1330 datetimepicker.on('afterOpen.xdsoft', function () { 1331 timeboxparent.xdsoftScroller(options); 1332 }); 1333 1334 datetimepicker 1335 .append(datepicker) 1336 .append(timepicker); 1337 1338 if (options.withoutCopyright !== true) { 1339 datetimepicker 1340 .append(xdsoft_copyright); 1341 } 1342 1343 datepicker 1344 .append(month_picker) 1345 .append(calendar) 1346 .append(applyButton); 1347 1348 $(options.parentID) 1349 .append(datetimepicker); 1350 1351 XDSoft_datetime = function () { 1352 var _this = this; 1353 _this.now = function (norecursion) { 1354 var d = new Date(), 1355 date, 1356 time; 1357 1358 if (!norecursion && options.defaultDate) { 1359 date = _this.strToDateTime(options.defaultDate); 1360 d.setFullYear(date.getFullYear()); 1361 d.setMonth(date.getMonth()); 1362 d.setDate(date.getDate()); 1363 } 1364 1365 d.setFullYear(d.getFullYear()); 1366 1367 if (!norecursion && options.defaultTime) { 1368 time = _this.strtotime(options.defaultTime); 1369 d.setHours(time.getHours()); 1370 d.setMinutes(time.getMinutes()); 1371 d.setSeconds(time.getSeconds()); 1372 d.setMilliseconds(time.getMilliseconds()); 1373 } 1374 return d; 1375 }; 1376 1377 _this.isValidDate = function (d) { 1378 if (Object.prototype.toString.call(d) !== "[object Date]") { 1379 return false; 1380 } 1381 return !isNaN(d.getTime()); 1382 }; 1383 1384 _this.setCurrentTime = function (dTime, requireValidDate) { 1385 if (typeof dTime === 'string') { 1386 _this.currentTime = _this.strToDateTime(dTime); 1387 } 1388 else if (_this.isValidDate(dTime)) { 1389 _this.currentTime = dTime; 1390 } 1391 else if (!dTime && !requireValidDate && options.allowBlank && !options.inline) { 1392 _this.currentTime = null; 1393 } 1394 else { 1395 _this.currentTime = _this.now(); 1396 } 1397 1398 datetimepicker.trigger('xchange.xdsoft'); 1399 }; 1400 1401 _this.empty = function () { 1402 _this.currentTime = null; 1403 }; 1404 1405 _this.getCurrentTime = function () { 1406 return _this.currentTime; 1407 }; 1408 1409 _this.nextMonth = function () { 1410 1411 if (_this.currentTime === undefined || _this.currentTime === null) { 1412 _this.currentTime = _this.now(); 1413 } 1414 1415 var month = _this.currentTime.getMonth() + 1, 1416 year; 1417 if (month === 12) { 1418 _this.currentTime.setFullYear(_this.currentTime.getFullYear() + 1); 1419 month = 0; 1420 } 1421 1422 year = _this.currentTime.getFullYear(); 1423 1424 _this.currentTime.setDate( 1425 Math.min( 1426 new Date(_this.currentTime.getFullYear(), month + 1, 0).getDate(), 1427 _this.currentTime.getDate() 1428 ) 1429 ); 1430 _this.currentTime.setMonth(month); 1431 1432 if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) { 1433 options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); 1434 } 1435 1436 if (year !== _this.currentTime.getFullYear() && $.isFunction(options.onChangeYear)) { 1437 options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); 1438 } 1439 1440 datetimepicker.trigger('xchange.xdsoft'); 1441 return month; 1442 }; 1443 1444 _this.prevMonth = function () { 1445 1446 if (_this.currentTime === undefined || _this.currentTime === null) { 1447 _this.currentTime = _this.now(); 1448 } 1449
vendor: 27,152 bytes, lines 1450-2163
1450 var month = _this.currentTime.getMonth() - 1; 1451 if (month === -1) { 1452 _this.currentTime.setFullYear(_this.currentTime.getFullYear() - 1); 1453 month = 11; 1454 } 1455 _this.currentTime.setDate( 1456 Math.min( 1457 new Date(_this.currentTime.getFullYear(), month + 1, 0).getDate(), 1458 _this.currentTime.getDate() 1459 ) 1460 ); 1461 _this.currentTime.setMonth(month); 1462 if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) { 1463 options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); 1464 } 1465 datetimepicker.trigger('xchange.xdsoft'); 1466 return month; 1467 }; 1468 1469 _this.getWeekOfYear = function (datetime) { 1470 if (options.onGetWeekOfYear && $.isFunction(options.onGetWeekOfYear)) { 1471 var week = options.onGetWeekOfYear.call(datetimepicker, datetime); 1472 if (typeof week !== 'undefined') { 1473 return week; 1474 } 1475 } 1476 var onejan = new Date(datetime.getFullYear(), 0, 1); 1477 1478 //First week of the year is th one with the first Thursday according to ISO8601 1479 if (onejan.getDay() !== 4) { 1480 onejan.setMonth(0, 1 + ((4 - onejan.getDay()+ 7) % 7)); 1481 } 1482 1483 return Math.ceil((((datetime - onejan) / 86400000) + onejan.getDay() + 1) / 7); 1484 }; 1485 1486 _this.strToDateTime = function (sDateTime) { 1487 var tmpDate = [], timeOffset, currentTime; 1488 1489 if (sDateTime && sDateTime instanceof Date && _this.isValidDate(sDateTime)) { 1490 return sDateTime; 1491 } 1492 1493 tmpDate = /^([+-]{1})(.*)$/.exec(sDateTime); 1494 1495 if (tmpDate) { 1496 tmpDate[2] = dateHelper.parseDate(tmpDate[2], options.formatDate); 1497 } 1498 1499 if (tmpDate && tmpDate[2]) { 1500 timeOffset = tmpDate[2].getTime() - (tmpDate[2].getTimezoneOffset()) * 60000; 1501 currentTime = new Date((_this.now(true)).getTime() + parseInt(tmpDate[1] + '1', 10) * timeOffset); 1502 } else { 1503 currentTime = sDateTime ? dateHelper.parseDate(sDateTime, options.format) : _this.now(); 1504 } 1505 1506 if (!_this.isValidDate(currentTime)) { 1507 currentTime = _this.now(); 1508 } 1509 1510 return currentTime; 1511 }; 1512 1513 _this.strToDate = function (sDate) { 1514 if (sDate && sDate instanceof Date && _this.isValidDate(sDate)) { 1515 return sDate; 1516 } 1517 1518 var currentTime = sDate ? dateHelper.parseDate(sDate, options.formatDate) : _this.now(true); 1519 if (!_this.isValidDate(currentTime)) { 1520 currentTime = _this.now(true); 1521 } 1522 return currentTime; 1523 }; 1524 1525 _this.strtotime = function (sTime) { 1526 if (sTime && sTime instanceof Date && _this.isValidDate(sTime)) { 1527 return sTime; 1528 } 1529 var currentTime = sTime ? dateHelper.parseDate(sTime, options.formatTime) : _this.now(true); 1530 if (!_this.isValidDate(currentTime)) { 1531 currentTime = _this.now(true); 1532 } 1533 return currentTime; 1534 }; 1535 1536 _this.str = function () { 1537 var format = options.format; 1538 if (options.yearOffset) { 1539 format = format.replace('Y', _this.currentTime.getFullYear() + options.yearOffset); 1540 format = format.replace('y', String(_this.currentTime.getFullYear() + options.yearOffset).substring(2, 4)); 1541 } 1542 return dateHelper.formatDate(_this.currentTime, format); 1543 }; 1544 _this.currentTime = this.now(); 1545 }; 1546 1547 _xdsoft_datetime = new XDSoft_datetime(); 1548 1549 applyButton.on('touchend click', function (e) {//pathbrite 1550 e.preventDefault(); 1551 datetimepicker.data('changed', true); 1552 _xdsoft_datetime.setCurrentTime(getCurrentValue()); 1553 input.val(_xdsoft_datetime.str()); 1554 datetimepicker.trigger('close.xdsoft'); 1555 }); 1556 month_picker 1557 .find('.xdsoft_today_button') 1558 .on('touchend mousedown.xdsoft', function () { 1559 datetimepicker.data('changed', true); 1560 _xdsoft_datetime.setCurrentTime(0, true); 1561 datetimepicker.trigger('afterOpen.xdsoft'); 1562 }).on('dblclick.xdsoft', function () { 1563 var currentDate = _xdsoft_datetime.getCurrentTime(), minDate, maxDate; 1564 currentDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate()); 1565 minDate = _xdsoft_datetime.strToDate(options.minDate); 1566 minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()); 1567 if (currentDate < minDate) { 1568 return; 1569 } 1570 maxDate = _xdsoft_datetime.strToDate(options.maxDate); 1571 maxDate = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()); 1572 if (currentDate > maxDate) { 1573 return; 1574 } 1575 input.val(_xdsoft_datetime.str()); 1576 input.trigger('change'); 1577 datetimepicker.trigger('close.xdsoft'); 1578 }); 1579 month_picker 1580 .find('.xdsoft_prev,.xdsoft_next') 1581 .on('touchend mousedown.xdsoft', function () { 1582 var $this = $(this), 1583 timer = 0, 1584 stop = false; 1585 1586 (function arguments_callee1(v) { 1587 if ($this.hasClass(options.next)) { 1588 _xdsoft_datetime.nextMonth(); 1589 } else if ($this.hasClass(options.prev)) { 1590 _xdsoft_datetime.prevMonth(); 1591 } 1592 if (options.monthChangeSpinner) { 1593 if (!stop) { 1594 timer = setTimeout(arguments_callee1, v || 100); 1595 } 1596 } 1597 }(500)); 1598 1599 $([options.ownerDocument.body, options.contentWindow]).on('touchend mouseup.xdsoft', function arguments_callee2() { 1600 clearTimeout(timer); 1601 stop = true; 1602 $([options.ownerDocument.body, options.contentWindow]).off('touchend mouseup.xdsoft', arguments_callee2); 1603 }); 1604 }); 1605 1606 timepicker 1607 .find('.xdsoft_prev,.xdsoft_next') 1608 .on('touchend mousedown.xdsoft', function () { 1609 var $this = $(this), 1610 timer = 0, 1611 stop = false, 1612 period = 110; 1613 (function arguments_callee4(v) { 1614 var pheight = timeboxparent[0].clientHeight, 1615 height = timebox[0].offsetHeight, 1616 top = Math.abs(parseInt(timebox.css('marginTop'), 10)); 1617 if ($this.hasClass(options.next) && (height - pheight) - options.timeHeightInTimePicker >= top) { 1618 timebox.css('marginTop', '-' + (top + options.timeHeightInTimePicker) + 'px'); 1619 } else if ($this.hasClass(options.prev) && top - options.timeHeightInTimePicker >= 0) { 1620 timebox.css('marginTop', '-' + (top - options.timeHeightInTimePicker) + 'px'); 1621 } 1622 /** 1623 * Fixed bug: 1624 * When using css3 transition, it will cause a bug that you cannot scroll the timepicker list. 1625 * The reason is that the transition-duration time, if you set it to 0, all things fine, otherwise, this 1626 * would cause a bug when you use jquery.css method. 1627 * Let's say: * { transition: all .5s ease; } 1628 * jquery timebox.css('marginTop') will return the original value which is before you clicking the next/prev button, 1629 * meanwhile the timebox[0].style.marginTop will return the right value which is after you clicking the 1630 * next/prev button. 1631 * 1632 * What we should do: 1633 * Replace timebox.css('marginTop') with timebox[0].style.marginTop. 1634 */ 1635 timeboxparent.trigger('scroll_element.xdsoft_scroller', [Math.abs(parseInt(timebox[0].style.marginTop, 10) / (height - pheight))]); 1636 period = (period > 10) ? 10 : period - 10; 1637 if (!stop) { 1638 timer = setTimeout(arguments_callee4, v || period); 1639 } 1640 }(500)); 1641 $([options.ownerDocument.body, options.contentWindow]).on('touchend mouseup.xdsoft', function arguments_callee5() { 1642 clearTimeout(timer); 1643 stop = true; 1644 $([options.ownerDocument.body, options.contentWindow]) 1645 .off('touchend mouseup.xdsoft', arguments_callee5); 1646 }); 1647 }); 1648 1649 xchangeTimer = 0; 1650 // base handler - generating a calendar and timepicker 1651 datetimepicker 1652 .on('xchange.xdsoft', function (event) { 1653 clearTimeout(xchangeTimer); 1654 xchangeTimer = setTimeout(function () { 1655 1656 if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null) { 1657 _xdsoft_datetime.currentTime = _xdsoft_datetime.now(); 1658 } 1659 1660 var table = '', 1661 start = new Date(_xdsoft_datetime.currentTime.getFullYear(), _xdsoft_datetime.currentTime.getMonth(), 1, 12, 0, 0), 1662 i = 0, 1663 j, 1664 today = _xdsoft_datetime.now(), 1665 maxDate = false, 1666 minDate = false, 1667 minDateTime = false, 1668 maxDateTime = false, 1669 hDate, 1670 day, 1671 d, 1672 y, 1673 m, 1674 w, 1675 classes = [], 1676 customDateSettings, 1677 newRow = true, 1678 time = '', 1679 h, 1680 line_time, 1681 description; 1682 1683 while (start.getDay() !== options.dayOfWeekStart) { 1684 start.setDate(start.getDate() - 1); 1685 } 1686 1687 table += '<table><thead><tr>'; 1688 1689 if (options.weeks) { 1690 table += '<th></th>'; 1691 } 1692 1693 for (j = 0; j < 7; j += 1) { 1694 table += '<th>' + options.i18n[globalLocale].dayOfWeekShort[(j + options.dayOfWeekStart) % 7] + '</th>'; 1695 } 1696 1697 table += '</tr></thead>'; 1698 table += '<tbody>'; 1699 1700 if (options.maxDate !== false) { 1701 maxDate = _xdsoft_datetime.strToDate(options.maxDate); 1702 maxDate = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate(), 23, 59, 59, 999); 1703 } 1704 1705 if (options.minDate !== false) { 1706 minDate = _xdsoft_datetime.strToDate(options.minDate); 1707 minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()); 1708 } 1709 1710 if (options.minDateTime !== false) { 1711 minDateTime = _xdsoft_datetime.strToDate(options.minDateTime); 1712 minDateTime = new Date(minDateTime.getFullYear(), minDateTime.getMonth(), minDateTime.getDate(), minDateTime.getHours(), minDateTime.getMinutes(), minDateTime.getSeconds()); 1713 } 1714 1715 if (options.maxDateTime !== false) { 1716 maxDateTime = _xdsoft_datetime.strToDate(options.maxDateTime); 1717 maxDateTime = new Date(maxDateTime.getFullYear(), maxDateTime.getMonth(), maxDateTime.getDate(), maxDateTime.getHours(), maxDateTime.getMinutes(), maxDateTime.getSeconds()); 1718 } 1719 1720 var maxDateTimeDay; 1721 if (maxDateTime !== false) { 1722 maxDateTimeDay = ((maxDateTime.getFullYear() * 12) + maxDateTime.getMonth()) * 31 + maxDateTime.getDate(); 1723 } 1724 1725 while (i < _xdsoft_datetime.currentTime.countDaysInMonth() || start.getDay() !== options.dayOfWeekStart || _xdsoft_datetime.currentTime.getMonth() === start.getMonth()) { 1726 classes = []; 1727 i += 1; 1728 1729 day = start.getDay(); 1730 d = start.getDate(); 1731 y = start.getFullYear(); 1732 m = start.getMonth(); 1733 w = _xdsoft_datetime.getWeekOfYear(start); 1734 description = ''; 1735 1736 classes.push('xdsoft_date'); 1737 1738 if (options.beforeShowDay && $.isFunction(options.beforeShowDay.call)) { 1739 customDateSettings = options.beforeShowDay.call(datetimepicker, start); 1740 } else { 1741 customDateSettings = null; 1742 } 1743 1744 if(options.allowDateRe && Object.prototype.toString.call(options.allowDateRe) === "[object RegExp]"){ 1745 if(!options.allowDateRe.test(dateHelper.formatDate(start, options.formatDate))){ 1746 classes.push('xdsoft_disabled'); 1747 } 1748 } 1749 1750 if(options.allowDates && options.allowDates.length>0){ 1751 if(options.allowDates.indexOf(dateHelper.formatDate(start, options.formatDate)) === -1){ 1752 classes.push('xdsoft_disabled'); 1753 } 1754 } 1755 1756 var currentDay = ((start.getFullYear() * 12) + start.getMonth()) * 31 + start.getDate(); 1757 if ((maxDate !== false && start > maxDate) || (minDateTime !== false && start < minDateTime) || (minDate !== false && start < minDate) || (maxDateTime !== false && currentDay > maxDateTimeDay) || (customDateSettings && customDateSettings[0] === false)) { 1758 classes.push('xdsoft_disabled'); 1759 } 1760 1761 if (options.disabledDates.indexOf(dateHelper.formatDate(start, options.formatDate)) !== -1) { 1762 classes.push('xdsoft_disabled'); 1763 } 1764 1765 if (options.disabledWeekDays.indexOf(day) !== -1) { 1766 classes.push('xdsoft_disabled'); 1767 } 1768 1769 if (input.is('[disabled]')) { 1770 classes.push('xdsoft_disabled'); 1771 } 1772 1773 if (customDateSettings && customDateSettings[1] !== "") { 1774 classes.push(customDateSettings[1]); 1775 } 1776 1777 if (_xdsoft_datetime.currentTime.getMonth() !== m) { 1778 classes.push('xdsoft_other_month'); 1779 } 1780 1781 if ((options.defaultSelect || datetimepicker.data('changed')) && dateHelper.formatDate(_xdsoft_datetime.currentTime, options.formatDate) === dateHelper.formatDate(start, options.formatDate)) { 1782 classes.push('xdsoft_current'); 1783 } 1784 1785 if (dateHelper.formatDate(today, options.formatDate) === dateHelper.formatDate(start, options.formatDate)) { 1786 classes.push('xdsoft_today'); 1787 } 1788 1789 if (start.getDay() === 0 || start.getDay() === 6 || options.weekends.indexOf(dateHelper.formatDate(start, options.formatDate)) !== -1) { 1790 classes.push('xdsoft_weekend'); 1791 } 1792 1793 if (options.highlightedDates[dateHelper.formatDate(start, options.formatDate)] !== undefined) { 1794 hDate = options.highlightedDates[dateHelper.formatDate(start, options.formatDate)]; 1795 classes.push(hDate.style === undefined ? 'xdsoft_highlighted_default' : hDate.style); 1796 description = hDate.desc === undefined ? '' : hDate.desc; 1797 } 1798 1799 if (options.beforeShowDay && $.isFunction(options.beforeShowDay)) { 1800 classes.push(options.beforeShowDay(start)); 1801 } 1802 1803 if (newRow) { 1804 table += '<tr>'; 1805 newRow = false; 1806 if (options.weeks) { 1807 table += '<th>' + w + '</th>'; 1808 } 1809 } 1810 1811 table += '<td data-date="' + d + '" data-month="' + m + '" data-year="' + y + '"' + ' class="xdsoft_date xdsoft_day_of_week' + start.getDay() + ' ' + classes.join(' ') + '" title="' + description + '">' + 1812 '<div>' + d + '</div>' + 1813 '</td>'; 1814 1815 if (start.getDay() === options.dayOfWeekStartPrev) { 1816 table += '</tr>'; 1817 newRow = true; 1818 } 1819 1820 start.setDate(d + 1); 1821 } 1822 table += '</tbody></table>'; 1823 1824 calendar.html(table); 1825 1826 month_picker.find('.xdsoft_label span').eq(0).text(options.i18n[globalLocale].months[_xdsoft_datetime.currentTime.getMonth()]); 1827 month_picker.find('.xdsoft_label span').eq(1).text(_xdsoft_datetime.currentTime.getFullYear() + options.yearOffset); 1828 1829 // generate timebox 1830 time = ''; 1831 h = ''; 1832 m = ''; 1833 1834 var minTimeMinutesOfDay = 0; 1835 if (options.minTime !== false) { 1836 var t = _xdsoft_datetime.strtotime(options.minTime); 1837 minTimeMinutesOfDay = 60 * t.getHours() + t.getMinutes(); 1838 } 1839 var maxTimeMinutesOfDay = 24 * 60; 1840 if (options.maxTime !== false) { 1841 var t = _xdsoft_datetime.strtotime(options.maxTime); 1842 maxTimeMinutesOfDay = 60 * t.getHours() + t.getMinutes(); 1843 } 1844 1845 if (options.minDateTime !== false) { 1846 var t = _xdsoft_datetime.strToDateTime(options.minDateTime); 1847 var currentDayIsMinDateTimeDay = dateHelper.formatDate(_xdsoft_datetime.currentTime, options.formatDate) === dateHelper.formatDate(t, options.formatDate); 1848 if (currentDayIsMinDateTimeDay) { 1849 var m = 60 * t.getHours() + t.getMinutes(); 1850 if (m > minTimeMinutesOfDay) minTimeMinutesOfDay = m; 1851 } 1852 } 1853 1854 if (options.maxDateTime !== false) { 1855 var t = _xdsoft_datetime.strToDateTime(options.maxDateTime); 1856 var currentDayIsMaxDateTimeDay = dateHelper.formatDate(_xdsoft_datetime.currentTime, options.formatDate) === dateHelper.formatDate(t, options.formatDate); 1857 if (currentDayIsMaxDateTimeDay) { 1858 var m = 60 * t.getHours() + t.getMinutes(); 1859 if (m < maxTimeMinutesOfDay) maxTimeMinutesOfDay = m; 1860 } 1861 } 1862 1863 line_time = function line_time(h, m) { 1864 var now = _xdsoft_datetime.now(), current_time, 1865 isALlowTimesInit = options.allowTimes && $.isArray(options.allowTimes) && options.allowTimes.length; 1866 now.setHours(h); 1867 h = parseInt(now.getHours(), 10); 1868 now.setMinutes(m); 1869 m = parseInt(now.getMinutes(), 10); 1870 classes = []; 1871 var currentMinutesOfDay = 60 * h + m; 1872 if (input.is('[disabled]') || (currentMinutesOfDay >= maxTimeMinutesOfDay) || (currentMinutesOfDay < minTimeMinutesOfDay)) { 1873 classes.push('xdsoft_disabled'); 1874 } 1875 1876 current_time = new Date(_xdsoft_datetime.currentTime); 1877 current_time.setHours(parseInt(_xdsoft_datetime.currentTime.getHours(), 10)); 1878 1879 if (!isALlowTimesInit) { 1880 current_time.setMinutes(Math[options.roundTime](_xdsoft_datetime.currentTime.getMinutes() / options.step) * options.step); 1881 } 1882 1883 if ((options.initTime || options.defaultSelect || datetimepicker.data('changed')) && current_time.getHours() === parseInt(h, 10) && ((!isALlowTimesInit && options.step > 59) || current_time.getMinutes() === parseInt(m, 10))) { 1884 if (options.defaultSelect || datetimepicker.data('changed')) { 1885 classes.push('xdsoft_current'); 1886 } else if (options.initTime) { 1887 classes.push('xdsoft_init_time'); 1888 } 1889 } 1890 if (parseInt(today.getHours(), 10) === parseInt(h, 10) && parseInt(today.getMinutes(), 10) === parseInt(m, 10)) { 1891 classes.push('xdsoft_today'); 1892 } 1893 time += '<div class="xdsoft_time ' + classes.join(' ') + '" data-hour="' + h + '" data-minute="' + m + '">' + dateHelper.formatDate(now, options.formatTime) + '</div>'; 1894 }; 1895 1896 if (!options.allowTimes || !$.isArray(options.allowTimes) || !options.allowTimes.length) { 1897 for (i = 0, j = 0; i < (options.hours12 ? 12 : 24); i += 1) { 1898 for (j = 0; j < 60; j += options.step) { 1899 var currentMinutesOfDay = i * 60 + j; 1900 if (currentMinutesOfDay < minTimeMinutesOfDay) continue; 1901 if (currentMinutesOfDay >= maxTimeMinutesOfDay) continue; 1902 h = (i < 10 ? '0' : '') + i; 1903 m = (j < 10 ? '0' : '') + j; 1904 line_time(h, m); 1905 } 1906 } 1907 } else { 1908 for (i = 0; i < options.allowTimes.length; i += 1) { 1909 h = _xdsoft_datetime.strtotime(options.allowTimes[i]).getHours(); 1910 m = _xdsoft_datetime.strtotime(options.allowTimes[i]).getMinutes(); 1911 line_time(h, m); 1912 } 1913 } 1914 1915 timebox.html(time); 1916 1917 opt = ''; 1918 1919 for (i = parseInt(options.yearStart, 10); i <= parseInt(options.yearEnd, 10); i += 1) { 1920 opt += '<div class="xdsoft_option ' + (_xdsoft_datetime.currentTime.getFullYear() === i ? 'xdsoft_current' : '') + '" data-value="' + i + '">' + (i + options.yearOffset) + '</div>'; 1921 } 1922 yearselect.children().eq(0) 1923 .html(opt); 1924 1925 for (i = parseInt(options.monthStart, 10), opt = ''; i <= parseInt(options.monthEnd, 10); i += 1) { 1926 opt += '<div class="xdsoft_option ' + (_xdsoft_datetime.currentTime.getMonth() === i ? 'xdsoft_current' : '') + '" data-value="' + i + '">' + options.i18n[globalLocale].months[i] + '</div>'; 1927 } 1928 monthselect.children().eq(0).html(opt); 1929 $(datetimepicker) 1930 .trigger('generate.xdsoft'); 1931 }, 10); 1932 event.stopPropagation(); 1933 }) 1934 .on('afterOpen.xdsoft', function () { 1935 if (options.timepicker) { 1936 var classType, pheight, height, top; 1937 if (timebox.find('.xdsoft_current').length) { 1938 classType = '.xdsoft_current'; 1939 } else if (timebox.find('.xdsoft_init_time').length) { 1940 classType = '.xdsoft_init_time'; 1941 } 1942 if (classType) { 1943 pheight = timeboxparent[0].clientHeight; 1944 height = timebox[0].offsetHeight; 1945 top = timebox.find(classType).index() * options.timeHeightInTimePicker + 1; 1946 if ((height - pheight) < top) { 1947 top = height - pheight; 1948 } 1949 timeboxparent.trigger('scroll_element.xdsoft_scroller', [parseInt(top, 10) / (height - pheight)]); 1950 } else { 1951 timeboxparent.trigger('scroll_element.xdsoft_scroller', [0]); 1952 } 1953 } 1954 }); 1955 1956 timerclick = 0; 1957 calendar 1958 .on('touchend click.xdsoft', 'td', function (xdevent) { 1959 xdevent.stopPropagation(); // Prevents closing of Pop-ups, Modals and Flyouts in Bootstrap 1960 timerclick += 1; 1961 var $this = $(this), 1962 currentTime = _xdsoft_datetime.currentTime; 1963 1964 if (currentTime === undefined || currentTime === null) { 1965 _xdsoft_datetime.currentTime = _xdsoft_datetime.now(); 1966 currentTime = _xdsoft_datetime.currentTime; 1967 } 1968 1969 if ($this.hasClass('xdsoft_disabled')) { 1970 return false; 1971 } 1972 1973 currentTime.setDate(1); 1974 currentTime.setFullYear($this.data('year')); 1975 currentTime.setMonth($this.data('month')); 1976 currentTime.setDate($this.data('date')); 1977 1978 datetimepicker.trigger('select.xdsoft', [currentTime]); 1979 1980 input.val(_xdsoft_datetime.str()); 1981 1982 if (options.onSelectDate && $.isFunction(options.onSelectDate)) { 1983 options.onSelectDate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent); 1984 } 1985 1986 datetimepicker.data('changed', true); 1987 datetimepicker.trigger('xchange.xdsoft'); 1988 datetimepicker.trigger('changedatetime.xdsoft'); 1989 if ((timerclick > 1 || (options.closeOnDateSelect === true || (options.closeOnDateSelect === false && !options.timepicker))) && !options.inline) { 1990 datetimepicker.trigger('close.xdsoft'); 1991 } 1992 setTimeout(function () { 1993 timerclick = 0; 1994 }, 200); 1995 }); 1996 1997 timebox 1998 .on('touchstart', 'div', function (xdevent) { 1999 this.touchMoved = false; 2000 }) 2001 .on('touchmove', 'div', handleTouchMoved) 2002 .on('touchend click.xdsoft', 'div', function (xdevent) { 2003 if (!this.touchMoved) { 2004 xdevent.stopPropagation(); 2005 var $this = $(this), 2006 currentTime = _xdsoft_datetime.currentTime; 2007 2008 if (currentTime === undefined || currentTime === null) { 2009 _xdsoft_datetime.currentTime = _xdsoft_datetime.now(); 2010 currentTime = _xdsoft_datetime.currentTime; 2011 } 2012 2013 if ($this.hasClass('xdsoft_disabled')) { 2014 return false; 2015 } 2016 currentTime.setHours($this.data('hour')); 2017 currentTime.setMinutes($this.data('minute')); 2018 datetimepicker.trigger('select.xdsoft', [currentTime]); 2019 2020 datetimepicker.data('input').val(_xdsoft_datetime.str()); 2021 2022 if (options.onSelectTime && $.isFunction(options.onSelectTime)) { 2023 options.onSelectTime.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent); 2024 } 2025 datetimepicker.data('changed', true); 2026 datetimepicker.trigger('xchange.xdsoft'); 2027 datetimepicker.trigger('changedatetime.xdsoft'); 2028 if (options.inline !== true && options.closeOnTimeSelect === true) { 2029 datetimepicker.trigger('close.xdsoft'); 2030 } 2031 } 2032 }); 2033 2034 datepicker 2035 .on('mousewheel.xdsoft', function (event) { 2036 if (!options.scrollMonth) { 2037 return true; 2038 } 2039 if (event.deltaY < 0) { 2040 _xdsoft_datetime.nextMonth(); 2041 } else { 2042 _xdsoft_datetime.prevMonth(); 2043 } 2044 return false; 2045 }); 2046 2047 input 2048 .on('mousewheel.xdsoft', function (event) { 2049 if (!options.scrollInput) { 2050 return true; 2051 } 2052 if (!options.datepicker && options.timepicker) { 2053 current_time_index = timebox.find('.xdsoft_current').length ? timebox.find('.xdsoft_current').eq(0).index() : 0; 2054 if (current_time_index + event.deltaY >= 0 && current_time_index + event.deltaY < timebox.children().length) { 2055 current_time_index += event.deltaY; 2056 } 2057 if (timebox.children().eq(current_time_index).length) { 2058 timebox.children().eq(current_time_index).trigger('mousedown'); 2059 } 2060 return false; 2061 } 2062 if (options.datepicker && !options.timepicker) { 2063 datepicker.trigger(event, [event.deltaY, event.deltaX, event.deltaY]); 2064 if (input.val) { 2065 input.val(_xdsoft_datetime.str()); 2066 } 2067 datetimepicker.trigger('changedatetime.xdsoft'); 2068 return false; 2069 } 2070 }); 2071 2072 datetimepicker 2073 .on('changedatetime.xdsoft', function (event) { 2074 if (options.onChangeDateTime && $.isFunction(options.onChangeDateTime)) { 2075 var $input = datetimepicker.data('input'); 2076 options.onChangeDateTime.call(datetimepicker, _xdsoft_datetime.currentTime, $input, event); 2077 delete options.value; 2078 $input.trigger('change'); 2079 } 2080 }) 2081 .on('generate.xdsoft', function () { 2082 if (options.onGenerate && $.isFunction(options.onGenerate)) { 2083 options.onGenerate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); 2084 } 2085 if (triggerAfterOpen) { 2086 datetimepicker.trigger('afterOpen.xdsoft'); 2087 triggerAfterOpen = false; 2088 } 2089 }) 2090 .on('click.xdsoft', function (xdevent) { 2091 xdevent.stopPropagation(); 2092 }); 2093 2094 current_time_index = 0; 2095 2096 /** 2097 * Runs the callback for each of the specified node's ancestors. 2098 * 2099 * Return FALSE from the callback to stop ascending. 2100 * 2101 * @param {DOMNode} node 2102 * @param {Function} callback 2103 * @returns {undefined} 2104 */ 2105 forEachAncestorOf = function (node, callback) { 2106 do { 2107 node = node.parentNode; 2108 2109 if (!node || callback(node) === false) { 2110 break; 2111 } 2112 } while (node.nodeName !== 'HTML'); 2113 }; 2114 2115 /** 2116 * Sets the position of the picker. 2117 * 2118 * @returns {undefined} 2119 */ 2120 setPos = function () { 2121 var dateInputOffset, 2122 dateInputElem, 2123 verticalPosition, 2124 left, 2125 position, 2126 datetimepickerElem, 2127 dateInputHasFixedAncestor, 2128 $dateInput, 2129 windowWidth, 2130 verticalAnchorEdge, 2131 datetimepickerCss, 2132 windowHeight, 2133 windowScrollTop; 2134 2135 $dateInput = datetimepicker.data('input'); 2136 dateInputOffset = $dateInput.offset(); 2137 dateInputElem = $dateInput[0]; 2138 2139 verticalAnchorEdge = 'top'; 2140 verticalPosition = (dateInputOffset.top + dateInputElem.offsetHeight) - 1; 2141 left = dateInputOffset.left; 2142 position = "absolute"; 2143 2144 windowWidth = $(options.contentWindow).width(); 2145 windowHeight = $(options.contentWindow).height(); 2146 windowScrollTop = $(options.contentWindow).scrollTop(); 2147 2148 if ((options.ownerDocument.documentElement.clientWidth - dateInputOffset.left) < datepicker.parent().outerWidth(true)) { 2149 var diff = datepicker.parent().outerWidth(true) - dateInputElem.offsetWidth; 2150 left = left - diff; 2151 } 2152 2153 if ($dateInput.parent().css('direction') === 'rtl') { 2154 left -= (datetimepicker.outerWidth() - $dateInput.outerWidth()); 2155 } 2156 2157 if (options.fixed) { 2158 verticalPosition -= windowScrollTop; 2159 left -= $(options.contentWindow).scrollLeft(); 2160 position = "fixed"; 2161 } else { 2162 dateInputHasFixedAncestor = false; 2163
vendor: 3,243 bytes, lines 2164-2254
2164 forEachAncestorOf(dateInputElem, function (ancestorNode) { 2165 if (ancestorNode === null) { 2166 return false; 2167 } 2168 2169 if (options.contentWindow.getComputedStyle(ancestorNode).getPropertyValue('position') === 'fixed') { 2170 dateInputHasFixedAncestor = true; 2171 return false; 2172 } 2173 }); 2174 2175 if (dateInputHasFixedAncestor) { 2176 position = 'fixed'; 2177 2178 //If the picker won't fit entirely within the viewport then display it above the date input. 2179 if (verticalPosition + datetimepicker.outerHeight() > windowHeight + windowScrollTop) { 2180 verticalAnchorEdge = 'bottom'; 2181 verticalPosition = (windowHeight + windowScrollTop) - dateInputOffset.top; 2182 } else { 2183 verticalPosition -= windowScrollTop; 2184 } 2185 } else { 2186 if (verticalPosition + datetimepicker[0].offsetHeight > windowHeight + windowScrollTop) { 2187 verticalPosition = dateInputOffset.top - datetimepicker[0].offsetHeight + 1; 2188 } 2189 } 2190 2191 if (verticalPosition < 0) { 2192 verticalPosition = 0; 2193 } 2194 2195 if (left + dateInputElem.offsetWidth > windowWidth) { 2196 left = windowWidth - dateInputElem.offsetWidth; 2197 } 2198 } 2199 2200 datetimepickerElem = datetimepicker[0]; 2201 2202 forEachAncestorOf(datetimepickerElem, function (ancestorNode) { 2203 var ancestorNodePosition; 2204 2205 ancestorNodePosition = options.contentWindow.getComputedStyle(ancestorNode).getPropertyValue('position'); 2206 2207 if (ancestorNodePosition === 'relative' && windowWidth >= ancestorNode.offsetWidth) { 2208 left = left - ((windowWidth - ancestorNode.offsetWidth) / 2); 2209 return false; 2210 } 2211 }); 2212 2213 datetimepickerCss = { 2214 position: position, 2215 left: left, 2216 top: '', //Initialize to prevent previous values interfering with new ones. 2217 bottom: '' //Initialize to prevent previous values interfering with new ones. 2218 }; 2219 2220 datetimepickerCss[verticalAnchorEdge] = verticalPosition; 2221 2222 datetimepicker.css(datetimepickerCss); 2223 }; 2224 2225 datetimepicker 2226 .on('open.xdsoft', function (event) { 2227 var onShow = true; 2228 if (options.onShow && $.isFunction(options.onShow)) { 2229 onShow = options.onShow.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event); 2230 } 2231 if (onShow !== false) { 2232 datetimepicker.show(); 2233 setPos(); 2234 $(options.contentWindow) 2235 .off('resize.xdsoft', setPos) 2236 .on('resize.xdsoft', setPos); 2237 2238 if (options.closeOnWithoutClick) { 2239 $([options.ownerDocument.body, options.contentWindow]).on('touchstart mousedown.xdsoft', function arguments_callee6() { 2240 datetimepicker.trigger('close.xdsoft'); 2241 $([options.ownerDocument.body, options.contentWindow]).off('touchstart mousedown.xdsoft', arguments_callee6); 2242 }); 2243 } 2244 } 2245 }) 2246 .on('close.xdsoft', function (event) { 2247 var onClose = true; 2248 month_picker 2249 .find('.xdsoft_month,.xdsoft_year') 2250 .find('.xdsoft_select') 2251 .hide(); 2252 if (options.onClose && $.isFunction(options.onClose)) { 2253 onClose = options.onClose.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event); 2254 }
vendor: 13,224 bytes, lines 2255-2656
2255 if (onClose !== false && !options.opened && !options.inline) { 2256 datetimepicker.hide(); 2257 } 2258 event.stopPropagation(); 2259 }) 2260 .on('toggle.xdsoft', function () { 2261 if (datetimepicker.is(':visible')) { 2262 datetimepicker.trigger('close.xdsoft'); 2263 } else { 2264 datetimepicker.trigger('open.xdsoft'); 2265 } 2266 }) 2267 .data('input', input); 2268 2269 timer = 0; 2270 2271 datetimepicker.data('xdsoft_datetime', _xdsoft_datetime); 2272 datetimepicker.setOptions(options); 2273 2274 function getCurrentValue() { 2275 var ct = false, time; 2276 2277 if (options.startDate) { 2278 ct = _xdsoft_datetime.strToDate(options.startDate); 2279 } else { 2280 ct = options.value || ((input && input.val && input.val()) ? input.val() : ''); 2281 if (ct) { 2282 ct = _xdsoft_datetime.strToDateTime(ct); 2283 if (options.yearOffset) { 2284 ct = new Date(ct.getFullYear() - options.yearOffset, ct.getMonth(), ct.getDate(), ct.getHours(), ct.getMinutes(), ct.getSeconds(), ct.getMilliseconds()); 2285 } 2286 } else if (options.defaultDate) { 2287 ct = _xdsoft_datetime.strToDateTime(options.defaultDate); 2288 if (options.defaultTime) { 2289 time = _xdsoft_datetime.strtotime(options.defaultTime); 2290 ct.setHours(time.getHours()); 2291 ct.setMinutes(time.getMinutes()); 2292 } 2293 } 2294 } 2295 2296 if (ct && _xdsoft_datetime.isValidDate(ct)) { 2297 datetimepicker.data('changed', true); 2298 } else { 2299 ct = ''; 2300 } 2301 2302 return ct || 0; 2303 } 2304 2305 function setMask(options) { 2306 2307 var isValidValue = function (mask, value) { 2308 var reg = mask 2309 .replace(/([\[\]\/\{\}\(\)\-\.\+]{1})/g, '\\$1') 2310 .replace(/_/g, '{digit+}') 2311 .replace(/([0-9]{1})/g, '{digit$1}') 2312 .replace(/\{digit([0-9]{1})\}/g, '[0-$1_]{1}') 2313 .replace(/\{digit[\+]\}/g, '[0-9_]{1}'); 2314 return (new RegExp(reg)).test(value); 2315 }, 2316 getCaretPos = function (input) { 2317 try { 2318 if (options.ownerDocument.selection && options.ownerDocument.selection.createRange) { 2319 var range = options.ownerDocument.selection.createRange(); 2320 return range.getBookmark().charCodeAt(2) - 2; 2321 } 2322 if (input.setSelectionRange) { 2323 return input.selectionStart; 2324 } 2325 } catch (e) { 2326 return 0; 2327 } 2328 }, 2329 setCaretPos = function (node, pos) { 2330 node = (typeof node === "string" || node instanceof String) ? options.ownerDocument.getElementById(node) : node; 2331 if (!node) { 2332 return false; 2333 } 2334 if (node.createTextRange) { 2335 var textRange = node.createTextRange(); 2336 textRange.collapse(true); 2337 textRange.moveEnd('character', pos); 2338 textRange.moveStart('character', pos); 2339 textRange.select(); 2340 return true; 2341 } 2342 if (node.setSelectionRange) { 2343 node.setSelectionRange(pos, pos); 2344 return true; 2345 } 2346 return false; 2347 }; 2348 2349 if(options.mask) { 2350 input.off('keydown.xdsoft'); 2351 } 2352 2353 if (options.mask === true) { 2354 if (dateHelper.formatMask) { 2355 options.mask = dateHelper.formatMask(options.format) 2356 } else { 2357 options.mask = options.format 2358 .replace(/Y/g, '9999') 2359 .replace(/F/g, '9999') 2360 .replace(/m/g, '19') 2361 .replace(/d/g, '39') 2362 .replace(/H/g, '29') 2363 .replace(/i/g, '59') 2364 .replace(/s/g, '59'); 2365 } 2366 } 2367 2368 if ($.type(options.mask) === 'string') { 2369 if (!isValidValue(options.mask, input.val())) { 2370 input.val(options.mask.replace(/[0-9]/g, '_')); 2371 setCaretPos(input[0], 0); 2372 } 2373 2374 input.off('paste.xdsoft').on('paste.xdsoft', function (event) { 2375 // couple options here 2376 // 1. return false - tell them they can't paste 2377 // 2. insert over current characters - minimal validation 2378 // 3. full fledged parsing and validation 2379 // let's go option 2 for now 2380 2381 // fires multiple times for some reason 2382 2383 // https://stackoverflow.com/a/30496488/1366033 2384 var clipboardData = event.clipboardData || event.originalEvent.clipboardData || window.clipboardData, 2385 pastedData = clipboardData.getData('text'), 2386 val = this.value, 2387 pos = this.selectionStart 2388 2389 var valueBeforeCursor = val.substr(0, pos); 2390 var valueAfterPaste = val.substr(pos + pastedData.length); 2391 2392 val = valueBeforeCursor + pastedData + valueAfterPaste; 2393 val = val.substring(0, options.mask.length) 2394 pos += pastedData.length; 2395 2396 if (isValidValue(options.mask, val)) { 2397 this.value = val; 2398 setCaretPos(this, pos); 2399 } else if ($.trim(val) === '') { 2400 this.value = options.mask.replace(/[0-9]/g, '_'); 2401 } else { 2402 input.trigger('error_input.xdsoft'); 2403 } 2404 2405 event.preventDefault(); 2406 return false; 2407 }); 2408 2409 input.on('keydown.xdsoft', function (event) { 2410 var val = this.value, 2411 key = event.which, 2412 pos = this.selectionStart, 2413 selEnd = this.selectionEnd, 2414 hasSel = pos !== selEnd, 2415 digit; 2416 2417 // only alow these characters 2418 if (((key >= KEY0 && key <= KEY9) || 2419 (key >= _KEY0 && key <= _KEY9)) || 2420 (key === BACKSPACE || key === DEL)) { 2421 2422 // get char to insert which is new character or placeholder ('_') 2423 digit = (key === BACKSPACE || key === DEL) ? '_' : 2424 String.fromCharCode((_KEY0 <= key && key <= _KEY9) ? key - KEY0 : key); 2425 2426 // we're deleting something, we're not at the start, and have normal cursor, move back one 2427 // if we have a selection length, cursor actually sits behind deletable char, not in front 2428 if (key === BACKSPACE && pos && !hasSel) { 2429 pos -= 1; 2430 } 2431 2432 // don't stop on a separator, continue whatever direction you were going 2433 // value char - keep incrementing position while on separator char and we still have room 2434 // del char - keep decrementing position while on separator char and we still have room 2435 while (true) { 2436 var maskValueAtCurPos = options.mask.substr(pos, 1); 2437 var posShorterThanMaskLength = pos < options.mask.length; 2438 var posGreaterThanZero = pos > 0; 2439 var notNumberOrPlaceholder = /[^0-9_]/; 2440 var curPosOnSep = notNumberOrPlaceholder.test(maskValueAtCurPos); 2441 var continueMovingPosition = curPosOnSep && posShorterThanMaskLength && posGreaterThanZero 2442 2443 // if we hit a real char, stay where we are 2444 if (!continueMovingPosition) break; 2445 2446 // hitting backspace in a selection, you can possibly go back any further - go forward 2447 pos += (key === BACKSPACE && !hasSel) ? -1 : 1; 2448 2449 } 2450 2451 2452 if (hasSel) { 2453 // pos might have moved so re-calc length 2454 var selLength = selEnd - pos 2455 2456 // if we have a selection length we will wipe out entire selection and replace with default template for that range 2457 var defaultBlank = options.mask.replace(/[0-9]/g, '_'); 2458 var defaultBlankSelectionReplacement = defaultBlank.substr(pos, selLength); 2459 var selReplacementRemainder = defaultBlankSelectionReplacement.substr(1) // might be empty 2460 2461 var valueBeforeSel = val.substr(0, pos); 2462 var insertChars = digit + selReplacementRemainder; 2463 var charsAfterSelection = val.substr(pos + selLength); 2464 2465 val = valueBeforeSel + insertChars + charsAfterSelection 2466 2467 } else { 2468 var valueBeforeCursor = val.substr(0, pos); 2469 var insertChar = digit; 2470 var valueAfterNextChar = val.substr(pos + 1); 2471 2472 val = valueBeforeCursor + insertChar + valueAfterNextChar 2473 } 2474 2475 if ($.trim(val) === '') { 2476 // if empty, set to default 2477 val = defaultBlank 2478 } else { 2479 // if at the last character don't need to do anything 2480 if (pos === options.mask.length) { 2481 event.preventDefault(); 2482 return false; 2483 } 2484 } 2485 2486 // resume cursor location 2487 pos += (key === BACKSPACE) ? 0 : 1; 2488 // don't stop on a separator, continue whatever direction you were going 2489 while (/[^0-9_]/.test(options.mask.substr(pos, 1)) && pos < options.mask.length && pos > 0) { 2490 pos += (key === BACKSPACE) ? 0 : 1; 2491 } 2492 2493 if (isValidValue(options.mask, val)) { 2494 this.value = val; 2495 setCaretPos(this, pos); 2496 } else if ($.trim(val) === '') { 2497 this.value = options.mask.replace(/[0-9]/g, '_'); 2498 } else { 2499 input.trigger('error_input.xdsoft'); 2500 } 2501 } else { 2502 if (([AKEY, CKEY, VKEY, ZKEY, YKEY].indexOf(key) !== -1 && ctrlDown) || [ESC, ARROWUP, ARROWDOWN, ARROWLEFT, ARROWRIGHT, F5, CTRLKEY, TAB, ENTER].indexOf(key) !== -1) { 2503 return true; 2504 } 2505 } 2506 2507 event.preventDefault(); 2508 return false; 2509 }); 2510 } 2511 } 2512 2513 _xdsoft_datetime.setCurrentTime(getCurrentValue()); 2514 2515 input 2516 .data('xdsoft_datetimepicker', datetimepicker) 2517 .on('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', function () { 2518 if (input.is(':disabled') || (input.data('xdsoft_datetimepicker').is(':visible') && options.closeOnInputClick)) { 2519 return; 2520 } 2521 if (!options.openOnFocus) { 2522 return; 2523 } 2524 clearTimeout(timer); 2525 timer = setTimeout(function () { 2526 if (input.is(':disabled')) { 2527 return; 2528 } 2529 2530 triggerAfterOpen = true; 2531 _xdsoft_datetime.setCurrentTime(getCurrentValue(), true); 2532 if(options.mask) { 2533 setMask(options); 2534 } 2535 datetimepicker.trigger('open.xdsoft'); 2536 }, 100); 2537 }) 2538 .on('keydown.xdsoft', function (event) { 2539 var elementSelector, 2540 key = event.which; 2541 if ([ENTER].indexOf(key) !== -1 && options.enterLikeTab) { 2542 elementSelector = $("input:visible,textarea:visible,button:visible,a:visible"); 2543 datetimepicker.trigger('close.xdsoft'); 2544 elementSelector.eq(elementSelector.index(this) + 1).focus(); 2545 return false; 2546 } 2547 if ([TAB].indexOf(key) !== -1) { 2548 datetimepicker.trigger('close.xdsoft'); 2549 return true; 2550 } 2551 }) 2552 .on('blur.xdsoft', function () { 2553 datetimepicker.trigger('close.xdsoft'); 2554 }); 2555 }; 2556 destroyDateTimePicker = function (input) { 2557 var datetimepicker = input.data('xdsoft_datetimepicker'); 2558 if (datetimepicker) { 2559 datetimepicker.data('xdsoft_datetime', null); 2560 datetimepicker.remove(); 2561 input 2562 .data('xdsoft_datetimepicker', null) 2563 .off('.xdsoft'); 2564 $(options.contentWindow).off('resize.xdsoft'); 2565 $([options.contentWindow, options.ownerDocument.body]).off('mousedown.xdsoft touchstart'); 2566 if (input.unmousewheel) { 2567 input.unmousewheel(); 2568 } 2569 } 2570 }; 2571 $(options.ownerDocument) 2572 .off('keydown.xdsoftctrl keyup.xdsoftctrl') 2573 .on('keydown.xdsoftctrl', function (e) { 2574 if (e.keyCode === CTRLKEY) { 2575 ctrlDown = true; 2576 } 2577 }) 2578 .on('keyup.xdsoftctrl', function (e) { 2579 if (e.keyCode === CTRLKEY) { 2580 ctrlDown = false; 2581 } 2582 }); 2583 2584 this.each(function () { 2585 var datetimepicker = $(this).data('xdsoft_datetimepicker'), $input; 2586 if (datetimepicker) { 2587 if ($.type(opt) === 'string') { 2588 switch (opt) { 2589 case 'show': 2590 $(this).select().focus(); 2591 datetimepicker.trigger('open.xdsoft'); 2592 break; 2593 case 'hide': 2594 datetimepicker.trigger('close.xdsoft'); 2595 break; 2596 case 'toggle': 2597 datetimepicker.trigger('toggle.xdsoft'); 2598 break; 2599 case 'destroy': 2600 destroyDateTimePicker($(this)); 2601 break; 2602 case 'reset': 2603 this.value = this.defaultValue; 2604 if (!this.value || !datetimepicker.data('xdsoft_datetime').isValidDate(dateHelper.parseDate(this.value, options.format))) { 2605 datetimepicker.data('changed', false); 2606 } 2607 datetimepicker.data('xdsoft_datetime').setCurrentTime(this.value); 2608 break; 2609 case 'validate': 2610 $input = datetimepicker.data('input'); 2611 $input.trigger('blur.xdsoft'); 2612 break; 2613 default: 2614 if (datetimepicker[opt] && $.isFunction(datetimepicker[opt])) { 2615 result = datetimepicker[opt](opt2); 2616 } 2617 } 2618 } else { 2619 datetimepicker 2620 .setOptions(opt); 2621 } 2622 return 0; 2623 } 2624 if ($.type(opt) !== 'string') { 2625 if (!options.lazyInit || options.open || options.inline) { 2626 createDateTimePicker($(this)); 2627 } else { 2628 lazyInit($(this)); 2629 } 2630 } 2631 }); 2632 2633 return result; 2634 }; 2635 2636 $.fn.datetimepicker.defaults = default_options; 2637 2638 function HighlightedDate(date, desc, style) { 2639 "use strict"; 2640 this.date = date; 2641 this.desc = desc; 2642 this.style = style; 2643 } 2644}; 2645;(function (factory) { 2646 if ( typeof define === 'function' && define.amd ) { 2647 // AMD. Register as an anonymous module. 2648 define(['jquery', 'jquery-mousewheel'], factory); 2649 } else if (typeof exports === 'object') { 2650 // Node/CommonJS style for Browserify 2651 module.exports = factory(require('jquery'));; 2652 } else { 2653 // Browser globals 2654 factory(jQuery); 2655 } 2656}
2656(datetimepickerFactory)); 2657/** 2658 * @preserve jQuery DateTimePicker 2659 * @homepage http://xdsoft.net/jqplugins/datetimepicker/ 2660 * @author Chupurnov Valeriy (<[email protected]>) 2661 */ 2662 2663/** 2664 * @param {jQuery} $ 2665 */ 2666var datetimepickerFactory = function ($) { 2667 'use strict'; 2668 2669 var default_options = { 2670 i18n: { 2671 ar: { // Arabic 2672 months: [ 2673 "ÙØ§ÙÙÙ Ø§ÙØ«Ø§ÙÙ", "شباط", "آذار", "ÙÙØ³Ø§Ù", "٠اÙÙ", "ØØ²ÙراÙ", "ØªÙ ÙØ²", "آب", "Ø£ÙÙÙÙ", "تشرÙÙ Ø§ÙØ£ÙÙ", "تشرÙÙ Ø§ÙØ«Ø§ÙÙ", "ÙØ§ÙÙÙ Ø§ÙØ£ÙÙ" 2674 ], 2675 dayOfWeekShort: [ 2676 "Ù", "Ø«", "ع", "Ø®", "ج", "س", "Ø" 2677 ], 2678 dayOfWeek: ["Ø§ÙØ£ØØ¯", "Ø§ÙØ§Ø«ÙÙÙ", "Ø§ÙØ«Ùاثاء", "Ø§ÙØ£Ø±Ø¨Ø¹Ø§Ø¡", "Ø§ÙØ®Ù ÙØ³", "Ø§ÙØ¬Ù عة", "Ø§ÙØ³Ø¨Øª", "Ø§ÙØ£ØØ¯"] 2679 }, 2680 ro: { // Romanian 2681 months: [ 2682 "Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie" 2683 ], 2684 dayOfWeekShort: [ 2685 "Du", "Lu", "Ma", "Mi", "Jo", "Vi", "Sâ" 2686 ], 2687 dayOfWeek: ["DuminicÄ", "Luni", "MarÅ£i", "Miercuri", "Joi", "Vineri", "SâmbÄtÄ"] 2688 }, 2689 id: { // Indonesian 2690 months: [ 2691 "Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember" 2692 ], 2693 dayOfWeekShort: [ 2694 "Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab" 2695 ], 2696 dayOfWeek: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"] 2697 }, 2698 is: { // Icelandic 2699 months: [ 2700 "Janúar", "Febrúar", "Mars", "AprÃl", "MaÃ", "JúnÃ", "JúlÃ", "Ãgúst", "September", "Október", "Nóvember", "Desember" 2701 ], 2702 dayOfWeekShort: [ 2703 "Sun", "Mán", "Ãrið", "Mið", "Fim", "Fös", "Lau" 2704 ], 2705 dayOfWeek: ["Sunnudagur", "Mánudagur", "Ãriðjudagur", "Miðvikudagur", "Fimmtudagur", "Föstudagur", "Laugardagur"] 2706 }, 2707 bg: { // Bulgarian 2708 months: [ 2709 "ЯнÑаÑи", "ФевÑÑаÑи", "ÐаÑÑ", "ÐпÑил", "Ðай", "Юни", "Юли", "ÐвгÑÑÑ", "СепÑемвÑи", "ÐкÑомвÑи", "ÐоемвÑи", "ÐекемвÑи" 2710 ], 2711 dayOfWeekShort: [ 2712 "Ðд", "Ðн", "ÐÑ", "СÑ", "ЧÑ", "ÐÑ", "Сб" 2713 ], 2714 dayOfWeek: ["ÐеделÑ", "Ðонеделник", "ÐÑоÑник", "СÑÑда", "ЧеÑвÑÑÑÑк", "ÐеÑÑк", "СÑбоÑа"] 2715 }, 2716 fa: { // Persian/Farsi 2717 months: [ 2718 'ÙØ±ÙردÛÙ', 'Ø§Ø±Ø¯ÛØ¨Ùشت', 'خرداد', 'ØªÛØ±', '٠رداد', 'Ø´ÙØ±ÛÙØ±', 'Ù ÙØ±', 'آباÙ', 'آذر', 'دÛ', 'بÙÙ Ù', 'اسÙÙØ¯' 2719 ], 2720 dayOfWeekShort: [ 2721 'ÛÚ©Ø´ÙØ¨Ù', 'Ø¯ÙØ´ÙبÙ', 'Ø³Ù Ø´ÙØ¨Ù', 'ÚÙØ§Ø±Ø´ÙبÙ', 'Ù¾ÙØ¬Ø´ÙبÙ', 'ج٠عÙ', 'Ø´ÙØ¨Ù' 2722 ], 2723 dayOfWeek: ["ÛÚ©âØ´ÙØ¨Ù", "Ø¯ÙØ´ÙبÙ", "سÙâØ´ÙØ¨Ù", "ÚÙØ§Ø±Ø´ÙبÙ", "Ù¾ÙØ¬âØ´ÙØ¨Ù", "ج٠عÙ", "Ø´ÙØ¨Ù", "ÛÚ©âØ´ÙØ¨Ù"] 2724 }, 2725 ru: { // Russian 2726 months: [ 2727 'ЯнваÑÑ', 'ФевÑалÑ', 'ÐаÑÑ', 'ÐпÑелÑ', 'Ðай', 'ÐÑнÑ', 'ÐÑлÑ', 'ÐвгÑÑÑ', 'СенÑÑбÑÑ', 'ÐкÑÑбÑÑ', 'ÐоÑбÑÑ', 'ÐекабÑÑ' 2728 ], 2729 dayOfWeekShort: [ 2730 "ÐÑ", "Ðн", "ÐÑ", "СÑ", "ЧÑ", "ÐÑ", "Сб" 2731 ], 2732 dayOfWeek: ["ÐоÑкÑеÑенÑе", "ÐонеделÑник", "ÐÑоÑник", "СÑеда", "ЧеÑвеÑг", "ÐÑÑниÑа", "СÑббоÑа"] 2733 }, 2734 uk: { // Ukrainian 2735 months: [ 2736 'СÑÑенÑ', 'ÐÑÑий', 'ÐеÑезенÑ', 'ÐвÑÑенÑ', 'ТÑавенÑ', 'ЧеÑвенÑ', 'ÐипенÑ', 'СеÑпенÑ', 'ÐеÑеÑенÑ', 'ÐовÑенÑ', 'ÐиÑÑопад', 'ÐÑÑденÑ' 2737 ], 2738 dayOfWeekShort: [ 2739 "Ðдл", "Ðнд", "ÐÑÑ", "СÑд", "ЧÑв", "ÐÑн", "СбÑ" 2740 ], 2741 dayOfWeek: ["ÐедÑлÑ", "ÐонедÑлок", "ÐÑвÑоÑок", "СеÑеда", "ЧеÑвеÑ", "Ð'ÑÑниÑÑ", "СÑбоÑа"] 2742 }, 2743 en: { // English 2744 months: [ 2745 "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "
2745November", "December" 2746 ], 2747 dayOfWeekShort: [ 2748 "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" 2749 ], 2750 dayOfWeek: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] 2751 }, 2752 el: { // Îλληνικά 2753 months: [ 2754 "ÎÎ±Î½Î¿Ï Î¬ÏιοÏ", "ΦεβÏÎ¿Ï Î¬ÏιοÏ", "ÎάÏÏιοÏ", "ÎÏÏίλιοÏ", "ÎάιοÏ", "ÎοÏνιοÏ", "ÎοÏλιοÏ", "ÎÏÎ³Î¿Ï ÏÏοÏ", "ΣεÏÏÎμβÏιοÏ", "ÎκÏÏβÏιοÏ", "ÎοÎμβÏιοÏ", "ÎεκÎμβÏιοÏ" 2755 ], 2756 dayOfWeekShort: [ 2757 "ÎÏ Ï", "ÎÎµÏ ", "ΤÏι", "ΤεÏ", "Πεμ", "ΠαÏ", "Σαβ" 2758 ], 2759 dayOfWeek: ["ÎÏ Ïιακή", "ÎÎµÏ ÏÎÏα", "ΤÏίÏη", "ΤεÏάÏÏη", "Î ÎμÏÏη", "ΠαÏαÏÎºÎµÏ Î®", "ΣάββαÏο"] 2760 }, 2761 de: { // German 2762 months: [ 2763 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember' 2764 ], 2765 dayOfWeekShort: [ 2766 "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa" 2767 ], 2768 dayOfWeek: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"] 2769 }, 2770 nl: { // Dutch 2771 months: [ 2772 "januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december" 2773 ], 2774 dayOfWeekShort: [ 2775 "zo", "ma", "di", "wo", "do", "vr", "za" 2776 ], 2777 dayOfWeek: ["zondag", "maandag", "dinsdag", "woensdag", "donderdag", "vrijdag", "zaterdag"] 2778 }, 2779 tr: { // Turkish 2780 months: [ 2781 "Ocak", "Åubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "AÄustos", "Eylül", "Ekim", "Kasım", "Aralık" 2782 ], 2783 dayOfWeekShort: [ 2784 "Paz", "Pts", "Sal", "Ãar", "Per", "Cum", "Cts" 2785 ], 2786 dayOfWeek: ["Pazar", "Pazartesi", "Salı", "ÃarÅamba", "PerÅembe", "Cuma", "Cumartesi"] 2787 }, 2788 fr: { //French 2789 months: [ 2790 "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre" 2791 ], 2792 dayOfWeekShort: [ 2793 "Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam" 2794 ], 2795 dayOfWeek: ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"] 2796 }, 2797 es: { // Spanish 2798 months: [ 2799 "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre" 2800 ], 2801 dayOfWeekShort: [ 2802 "Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb" 2803 ], 2804 dayOfWeek: ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"] 2805 }, 2806 th: { // Thai 2807 months: [ 2808 'มà¸à¸£à¸²à¸à¸¡', 'à¸à¸¸à¸¡à¸ าà¸à¸±à¸à¸à¹', 'มีà¸à¸²à¸à¸¡', 'à¹à¸¡à¸©à¸²à¸¢à¸', 'à¸à¸¤à¸©à¸ าà¸à¸¡', 'มิà¸à¸¸à¸à¸²à¸¢à¸', 'à¸à¸£à¸à¸à¸²à¸à¸¡', 'สิà¸à¸«à¸²à¸à¸¡', 'à¸à¸±à¸à¸¢à¸²à¸¢à¸', 'à¸à¸¸à¸¥à¸²à¸à¸¡', 'à¸à¸¤à¸¨à¸à¸´à¸à¸²à¸¢à¸', 'à¸à¸±à¸à¸§à¸²à¸à¸¡' 2809 ], 2810 dayOfWeekShort: [ 2811 'à¸à¸².', 'à¸.', 'à¸.', 'à¸.', 'à¸à¸¤.', 'ศ.', 'ส.' 2812 ], 2813 dayOfWeek: ["à¸à¸²à¸à¸´à¸à¸¢à¹", "à¸à¸±à¸à¸à¸£à¹", "à¸à¸±à¸à¸à¸²à¸£", "à¸à¸¸à¸", "à¸à¸¤à¸«à¸±à¸ª", "ศุà¸à¸£à¹", "à¹à¸ªà¸²à¸£à¹", "à¸à¸²à¸à¸´à¸à¸¢à¹"] 2814 }, 2815 pl: { // Polish 2816 months: [ 2817 "styczeÅ", "luty", "marzec", "kwiecieÅ", "maj", "czerwiec", "lipiec", "sierpieÅ", "wrzesieÅ", "październik", "listopad", "grudzieÅ" 2818 ], 2819 dayOfWeekShort: [ 2820 "nd", "pn", "wt", "År", "cz", "pt", "sb" 2821 ], 2822 dayOfWeek: ["niedziela", "poniedziaÅek", "wtorek", "Åroda", "czwartek", "piÄ tek", "sobota"] 2823 }, 2824 pt: { // Portuguese 2825 months: [ 2826 "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro" 2827 ], 2828 dayOfWeekShort: [ 2829 "Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab" 2830 ], 2831 dayOfWeek: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"] 2832 }, 2833 ch: { // Simplified Chinese 2834 months: [ 2835 "䏿", "äºæ", "䏿", "åæ", "äºæ", "å æ", "䏿", "å «æ", "乿", "åæ", "å䏿", "åäºæ" 2836 ], 2837 dayOfWeekShort: [ 2838 "æ¥", "ä¸", "äº", "ä¸", "å", "äº", "å " 2839 ] 2840 },
2841 se: { // Swedish 2842 months: [ 2843 "Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December" 2844 ], 2845 dayOfWeekShort: [ 2846 "Sön", "MÃ¥n", "Tis", "Ons", "Tor", "Fre", "Lör" 2847 ] 2848 }, 2849 km: { // Khmer (áá¶áá¶ááááá) 2850 months: [ 2851 "áááá¶â", "áá»áááá", "áá·áá¶â", "áááá¶â", "á§ááá¶â", "áá·áá»áá¶â", "áááááá¶â", "áá¸á á¶â", "ááááá¶â", "áá»áá¶â", "áá·á ááá·áá¶", "áááá¼â" 2852 ], 2853 dayOfWeekShort: ["á¢á¶áá·â", "á ááááâ", "á¢áááá¶áâ", "áá»áâ", "áááá ââ", "áá»áááâ", "áá áá"], 2854 dayOfWeek: ["á¢á¶áá·áááâ", "á ááááâ", "á¢áááá¶áâ", "áá»áâ", "áááá ááááá·áâ", "áá»áááâ", "áá áá"] 2855 }, 2856 kr: { // Korean 2857 months: [ 2858 "1ì", "2ì", "3ì", "4ì", "5ì", "6ì", "7ì", "8ì", "9ì", "10ì", "11ì", "12ì" 2859 ], 2860 dayOfWeekShort: [ 2861 "ì¼", "ì", "í", "ì", "목", "ê¸", "í " 2862 ], 2863 dayOfWeek: ["ì¼ìì¼", "ììì¼", "íìì¼", "ììì¼", "목ìì¼", "ê¸ìì¼", "í ìì¼"] 2864 }, 2865 it: { // Italian 2866 months: [ 2867 "Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre" 2868 ], 2869 dayOfWeekShort: [ 2870 "Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab" 2871 ], 2872 dayOfWeek: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"] 2873 }, 2874 da: { // Dansk 2875 months: [ 2876 "Januar", "Februar", "Marts", "April", "Maj", "Juni", "Juli", "August", "September", "Oktober", "November", "December" 2877 ], 2878 dayOfWeekShort: [ 2879 "Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør" 2880 ], 2881 dayOfWeek: ["søndag", "mandag", "tirsdag", "onsdag", "torsdag", "fredag", "lørdag"] 2882 }, 2883 no: { // Norwegian 2884 months: [ 2885 "Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember" 2886 ], 2887 dayOfWeekShort: [ 2888 "Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør" 2889 ], 2890 dayOfWeek: ['Søndag', 'Mandag', 'Tirsdag', 'Onsdag', 'Torsdag', 'Fredag', 'Lørdag'] 2891 }, 2892 ja: { // Japanese 2893 months: [ 2894 "1æ", "2æ", "3æ", "4æ", "5æ", "6æ", "7æ", "8æ", "9æ", "10æ", "11æ", "12æ" 2895 ], 2896 dayOfWeekShort: [ 2897 "æ¥", "æ", "ç«", "æ°´", "æ¨", "é", "å" 2898 ], 2899 dayOfWeek: ["æ¥æ", "ææ", "ç«æ", "æ°´æ", "æ¨æ", "éæ", "åæ"] 2900 }, 2901 vi: { // Vietnamese 2902 months: [ 2903 "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" 2904 ], 2905 dayOfWeekShort: [ 2906 "CN", "T2", "T3", "T4", "T5", "T6", "T7" 2907 ], 2908 dayOfWeek: ["Chá»§ nháºt", "Thứ hai", "Thứ ba", "Thứ tư", "Thứ nÄm", "Thứ sáu", "Thứ bảy"] 2909 }, 2910 sl: { // SlovenÅ¡Äina 2911 months: [ 2912 "Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December" 2913 ], 2914 dayOfWeekShort: [ 2915 "Ned", "Pon", "Tor", "Sre", "Äet", "Pet", "Sob" 2916 ], 2917 dayOfWeek: ["Nedelja", "Ponedeljek", "Torek", "Sreda", "Äetrtek", "Petek", "Sobota"] 2918 }, 2919 cs: { // ÄeÅ¡tina 2920 months: [ 2921 "Leden", "Ãnor", "BÅezen", "Duben", "KvÄten", "Äerven", "Äervenec", "Srpen", "ZáÅÃ", "ÅÃjen", "Listopad", "Prosinec" 2922 ], 2923 dayOfWeekShort: [ 2924 "Ne", "Po", "Ãt", "St", "Ät", "Pá", "So" 2925 ] 2926 }, 2927 hu: { // Hungarian 2928 months: [ 2929 "Január", "Február", "Március", "Ãprilis", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December" 2930 ], 2931 dayOfWeekShort: [ 2932 "Va", "Hé", "Ke", "Sze", "Cs", "Pé", "Szo" 2933 ], 2934 dayOfWeek: ["vasárnap", "hétfÅ", "kedd", "szerda", "csütörtök", "péntek", "szombat"] 2935 }, 2936 az: { //Azerbaijanian (Azeri) 2937 months: [ 2938 "Yanvar", "Fevral", "Mart", "Aprel", "May", "Iyun", "Iyul", "Avqust", "Sentyabr", "Oktyabr", "Noyabr", "Dekabr" 2939 ], 2940 dayOfWeekShort: [ 2941 "B", "Be", "Ãa", "Ã", "Ca", "C", "Å" 2942 ], 2943 dayOfWeek: ["Bazar", "Bazar ertÉsi", "ÃÉrÅÉnbÉ axÅamı", "ÃÉrÅÉnbÉ", "CümÉ axÅamı", "CümÉ", "ÅÉnbÉ"] 2944 }, 2945 bs: { //Bosanski 2946 months: [ 2947 "Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar" 2948 ], 2949 dayOfWeekShort: [ 2950 "Ned", "Pon", "Uto", "Sri", "Äet", "Pet", "Sub" 2951 ], 2952 dayOfWeek: ["Nedjelja","Ponedjeljak", "Utorak", "Srijeda", "Äetvrtak", "Petak", "Subota"] 2953 }, 2954 ca: { //Català 2955 months: [ 2956 "Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre" 2957 ], 2958 dayOfWeekShort: [ 2959 "Dg", "Dl", "Dt", "Dc", "Dj", "Dv", "Ds" 2960 ], 2961 dayOfWeek: ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"] 2962 }, 2963 'en-GB': { //English (British) 2964 months: [ 2965 "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "
2965November", "December" 2966 ], 2967 dayOfWeekShort: [ 2968 "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" 2969 ], 2970 dayOfWeek: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] 2971 }, 2972 et: { //"Eesti" 2973 months: [ 2974 "Jaanuar", "Veebruar", "Märts", "Aprill", "Mai", "Juuni", "Juuli", "August", "September", "Oktoober", "November", "Detsember" 2975 ], 2976 dayOfWeekShort: [ 2977 "P", "E", "T", "K", "N", "R", "L" 2978 ], 2979 dayOfWeek: ["Pühapäev", "Esmaspäev", "Teisipäev", "Kolmapäev", "Neljapäev", "Reede", "Laupäev"] 2980 }, 2981 eu: { //Euskara 2982 months: [ 2983 "Urtarrila", "Otsaila", "Martxoa", "Apirila", "Maiatza", "Ekaina", "Uztaila", "Abuztua", "Iraila", "Urria", "Azaroa", "Abendua" 2984 ], 2985 dayOfWeekShort: [ 2986 "Ig.", "Al.", "Ar.", "Az.", "Og.", "Or.", "La." 2987 ], 2988 dayOfWeek: ['Igandea', 'Astelehena', 'Asteartea', 'Asteazkena', 'Osteguna', 'Ostirala', 'Larunbata'] 2989 }, 2990 fi: { //Finnish (Suomi) 2991 months: [ 2992 "Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu" 2993 ], 2994 dayOfWeekShort: [ 2995 "Su", "Ma", "Ti", "Ke", "To", "Pe", "La" 2996 ], 2997 dayOfWeek: ["sunnuntai", "maanantai", "tiistai", "keskiviikko", "torstai", "perjantai", "lauantai"] 2998 }, 2999 gl: { //Galego 3000 months: [ 3001 "Xan", "Feb", "Maz", "Abr", "Mai", "Xun", "Xul", "Ago", "Set", "Out", "Nov", "Dec" 3002 ], 3003 dayOfWeekShort: [ 3004 "Dom", "Lun", "Mar", "Mer", "Xov", "Ven", "Sab" 3005 ], 3006 dayOfWeek: ["Domingo", "Luns", "Martes", "Mércores", "Xoves", "Venres", "Sábado"] 3007 }, 3008 hr: { //Hrvatski 3009 months: [ 3010 "SijeÄanj", "VeljaÄa", "Ožujak", "Travanj", "Svibanj", "Lipanj", "Srpanj", "Kolovoz", "Rujan", "Listopad", "Studeni", "Prosinac" 3011 ], 3012 dayOfWeekShort: [ 3013 "Ned", "Pon", "Uto", "Sri", "Äet", "Pet", "Sub" 3014 ], 3015 dayOfWeek: ["Nedjelja", "Ponedjeljak", "Utorak", "Srijeda", "Äetvrtak", "Petak", "Subota"] 3016 }, 3017 ko: { //Korean (íêµì´) 3018 months: [ 3019 "1ì", "2ì", "3ì", "4ì", "5ì", "6ì", "7ì", "8ì", "9ì", "10ì", "11ì", "12ì" 3020 ], 3021 dayOfWeekShort: [ 3022 "ì¼", "ì", "í", "ì", "목", "ê¸", "í " 3023 ], 3024 dayOfWeek: ["ì¼ìì¼", "ììì¼", "íìì¼", "ììì¼", "목ìì¼", "ê¸ìì¼", "í ìì¼"] 3025 }, 3026 lt: { //Lithuanian (lietuvių) 3027 months: [ 3028 "Sausio", "Vasario", "Kovo", "Balandžio", "GegužÄs", "Birželio", "Liepos", "RugpjÅ«Äio", "RugsÄjo", "Spalio", "LapkriÄio", "Gruodžio" 3029 ], 3030 dayOfWeekShort: [ 3031 "Sek", "Pir", "Ant", "Tre", "Ket", "Pen", "Å eÅ¡" 3032 ], 3033 dayOfWeek: ["Sekmadienis", "Pirmadienis", "Antradienis", "TreÄiadienis", "Ketvirtadienis", "Penktadienis", "Å eÅ¡tadienis"] 3034 }, 3035 lv: { //Latvian (LatvieÅ¡u) 3036 months: [ 3037 "JanvÄris", "FebruÄris", "Marts", "AprÄ«lis ", "Maijs", "JÅ«nijs", "JÅ«lijs", "Augusts", "Septembris", "Oktobris", "Novembris", "Decembris" 3038 ], 3039 dayOfWeekShort: [ 3040 "Sv", "Pr", "Ot", "Tr", "Ct", "Pk", "St" 3041 ], 3042 dayOfWeek: ["SvÄtdiena", "Pirmdiena", "Otrdiena", "TreÅ¡diena", "Ceturtdiena", "Piektdiena", "Sestdiena"] 3043 }, 3044 mk: { //Macedonian (ÐакедонÑки) 3045 months: [ 3046 "ÑанÑаÑи", "ÑевÑÑаÑи", "маÑÑ", "апÑил", "маÑ", "ÑÑни", "ÑÑли", "авгÑÑÑ", "ÑепÑемвÑи", "окÑомвÑи", "ноемвÑи", "декемвÑи" 3047 ], 3048 dayOfWeekShort: [ 3049 "нед", "пон", "вÑо", "ÑÑе", "ÑеÑ", "пеÑ", "Ñаб" 3050 ], 3051 dayOfWeek: ["Ðедела", "Ðонеделник", "ÐÑоÑник", "СÑеда", "ЧеÑвÑÑок", "ÐеÑок", "СабоÑа"] 3052 }, 3053 mn: { //Mongolian (Ðонгол) 3054 months: [ 3055 "1-Ñ ÑаÑ", "2-Ñ ÑаÑ", "3-Ñ ÑаÑ", "4-Ñ ÑаÑ", "5-Ñ ÑаÑ", "6-Ñ ÑаÑ", "7-Ñ ÑаÑ", "8-Ñ ÑаÑ", "9-Ñ ÑаÑ", "10-Ñ ÑаÑ", "11-Ñ ÑаÑ", "12-Ñ ÑаÑ" 3056 ], 3057 dayOfWeekShort: [ 3058 "Ðав", "ÐÑг", "ÐÑ Ð°", "ÐÒ¯Ñ", "ÐÑн", "ÐÑм", "ÐÑм" 3059 ], 3060 dayOfWeek: ["Ðаваа", "ÐÑгмаÑ", "ÐÑ Ð°Ð³Ð²Ð°", "ÐÒ¯ÑÑв", "ÐааÑан", "ÐÑмба", "ÐÑм"] 3061 }, 3062 'pt-BR': { //Português(Brasil) 3063 months: [ 3064 "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro" 3065 ], 3066 dayOfWeekShort: [ 3067 "Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb" 3068 ], 3069 dayOfWeek: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "SÃ
3069¡bado"] 3070 }, 3071 sk: { //SlovenÄina 3072 months: [ 3073 "Január", "Február", "Marec", "AprÃl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December" 3074 ], 3075 dayOfWeekShort: [ 3076 "Ne", "Po", "Ut", "St", "Å t", "Pi", "So" 3077 ], 3078 dayOfWeek: ["Nedeľa", "Pondelok", "Utorok", "Streda", "Å tvrtok", "Piatok", "Sobota"] 3079 }, 3080 sq: { //Albanian (Shqip) 3081 months: [ 3082 "Janar", "Shkurt", "Mars", "Prill", "Maj", "Qershor", "Korrik", "Gusht", "Shtator", "Tetor", "Nëntor", "Dhjetor" 3083 ], 3084 dayOfWeekShort: [ 3085 "Die", "Hën", "Mar", "Mër", "Enj", "Pre", "Shtu" 3086 ], 3087 dayOfWeek: ["E Diel", "E Hënë", "E MartÄ", "E Mërkurë", "E Enjte", "E Premte", "E Shtunë"] 3088 }, 3089 'sr-YU': { //Serbian (Srpski) 3090 months: [ 3091 "Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar" 3092 ], 3093 dayOfWeekShort: [ 3094 "Ned", "Pon", "Uto", "Sre", "Äet", "Pet", "Sub" 3095 ], 3096 dayOfWeek: ["Nedelja","Ponedeljak", "Utorak", "Sreda", "Äetvrtak", "Petak", "Subota"] 3097 }, 3098 sr: { //Serbian Cyrillic (СÑпÑки) 3099 months: [ 3100 "ÑанÑаÑ", "ÑебÑÑаÑ", "маÑÑ", "апÑил", "маÑ", "ÑÑн", "ÑÑл", "авгÑÑÑ", "ÑепÑембаÑ", "окÑобаÑ", "новембаÑ", "деÑембаÑ" 3101 ], 3102 dayOfWeekShort: [ 3103 "нед", "пон", "ÑÑо", "ÑÑе", "ÑеÑ", "пеÑ", "ÑÑб" 3104 ], 3105 dayOfWeek: ["ÐедеÑа","ÐонедеÑак", "УÑоÑак", "СÑеда", "ЧеÑвÑÑак", "ÐеÑак", "СÑбоÑа"] 3106 }, 3107 sv: { //Svenska 3108 months: [ 3109 "Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December" 3110 ], 3111 dayOfWeekShort: [ 3112 "Sön", "MÃ¥n", "Tis", "Ons", "Tor", "Fre", "Lör" 3113 ], 3114 dayOfWeek: ["Söndag", "MÃ¥ndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"] 3115 }, 3116 'zh-TW': { //Traditional Chinese (ç¹é«ä¸æ) 3117 months: [ 3118 "䏿", "äºæ", "䏿", "åæ", "äºæ", "å æ", "䏿", "å «æ", "乿", "åæ", "å䏿", "åäºæ" 3119 ], 3120 dayOfWeekShort: [ 3121 "æ¥", "ä¸", "äº", "ä¸", "å", "äº", "å " 3122 ], 3123 dayOfWeek: ["æææ¥", "ææä¸", "ææäº", "ææä¸", "ææå", "ææäº", "ææå "] 3124 }, 3125 zh: { //Simplified Chinese (ç®ä½ä¸æ) 3126 months: [ 3127 "䏿", "äºæ", "䏿", "åæ", "äºæ", "å æ", "䏿", "å «æ", "乿", "åæ", "å䏿", "åäºæ" 3128 ], 3129 dayOfWeekShort: [ 3130 "æ¥", "ä¸", "äº", "ä¸", "å", "äº", "å " 3131 ], 3132 dayOfWeek: ["æææ¥", "ææä¸", "ææäº", "ææä¸", "ææå", "ææäº", "ææå "] 3133 }, 3134 ug:{ // Uyghur(ئÛÙØºÛرÚÛ) 3135 months: [ 3136 "1-ئاÙ","2-ئاÙ","3-ئاÙ","4-ئاÙ","5-ئاÙ","6-ئاÙ","7-ئاÙ","8-ئاÙ","9-ئاÙ","10-ئاÙ","11-ئاÙ","12-ئاÙ" 3137 ], 3138 dayOfWeek: [ 3139 "ÙÛÙØ´ÛÙØ¨Û", "Ø¯ÛØ´ÛÙØ¨Û","سÛÙØ´ÛÙØ¨Û","ÚØ§Ø±Ø´ÛÙØ¨Û","Ù¾ÛÙØ´ÛÙØ¨Û","جÛÙ Û","Ø´ÛÙØ¨Û" 3140 ] 3141 }, 3142 he: { //Hebrew (×¢×ר×ת) 3143 months: [ 3144 '×× ××ר', 'פ×ר××ר', '×רץ', '×פר××', '×××', '××× ×', '××××', '××××ס×', 'ספ×××ר', '×××§×××ר', '× ××××ר', '×צ××ר' 3145 ], 3146 dayOfWeekShort: [ 3147 '×\'', '×\'', '×\'', '×\'', '×\'', '×\'', 'ש×ת' 3148 ], 3149 dayOfWeek: ["ר×ש××", "×©× ×", "ש××ש×", "ר×××¢×", "×××ש×", "ש×ש×", "ש×ת", "ר×ש××"] 3150 }, 3151 hy: { // Armenian 3152 months: [ 3153 "ÕÕ¸ÖÕ¶Õ¾Õ¡Ö", "ÕÕ¥Õ¿ÖÕ¾Õ¡Ö", "ÕÕ¡ÖÕ¿", "Ô±ÕºÖÕ«Õ¬", "ÕÕ¡ÕµÕ«Õ½", "ÕÕ¸ÖÕ¶Õ«Õ½", "ÕÕ¸ÖÕ¬Õ«Õ½", "ÕÕ£Õ¸Õ½Õ¿Õ¸Õ½", "ÕÕ¥ÕºÕ¿Õ¥Õ´Õ¢Õ¥Ö", "ÕÕ¸Õ¯Õ¿Õ¥Õ´Õ¢Õ¥Ö", "ÕÕ¸ÕµÕ¥Õ´Õ¢Õ¥Ö", "Ô´Õ¥Õ¯Õ¿Õ¥Õ´Õ¢Õ¥Ö" 3154 ], 3155 dayOfWeekShort: [ 3156 "Ô¿Õ«", "ÔµÖÕ¯", "ÔµÖÖ", "ÕÕ¸Ö", "ÕÕ¶Õ£", "ÕÖÖÕ¢", "ÕÕ¢Õ©" 3157 ], 3158 dayOfWeek: ["Ô¿Õ«ÖÕ¡Õ¯Õ«", "ÔµÖÕ¯Õ¸ÖÕ·Õ¡Õ¢Õ©Õ«", "ÔµÖÕ¥ÖÕ·Õ¡Õ¢Õ©Õ«", "ÕÕ¸ÖÕ¥ÖÕ·Õ¡Õ¢Õ©Õ«", "ÕÕ«Õ¶Õ£Õ·Õ¡Õ¢Õ©Õ«", "ÕÖÖÕ¢Õ¡Õ©", "ÕÕ¡Õ¢Õ¡Õ©"] 3159 }, 3160 kg: { // Kyrgyz 3161 months: [
vendor: 11,897 bytes, lines 3162-3550
3162 'Ò®ÑÑүн айÑ', 'ÐиÑдин айÑ', 'Ðалган ÐÑÑан', 'ЧÑн ÐÑÑан', 'ÐÑгÑ', 'ÐÑлжа', 'Теке', 'ÐÐ°Ñ Ðона', 'ÐÑк Ðона', 'ТогÑздÑн айÑ', 'ÐеÑинин айÑ', 'ÐеÑÑин айÑ' 3163 ], 3164 dayOfWeekShort: [ 3165 "Ðек", "Ðүй", "Шей", "ШаÑ", "Ðей", "ÐÑм", "ÐÑе" 3166 ], 3167 dayOfWeek: [ 3168 "ÐекÑемб", "ÐүйÑөмб", "ШейÑемб", "ШаÑÑемб", "ÐейÑемби", "ÐÑма", "ÐÑенб" 3169 ] 3170 }, 3171 rm: { // Romansh 3172 months: [ 3173 "Schaner", "Favrer", "Mars", "Avrigl", "Matg", "Zercladur", "Fanadur", "Avust", "Settember", "October", "November", "December" 3174 ], 3175 dayOfWeekShort: [ 3176 "Du", "Gli", "Ma", "Me", "Gie", "Ve", "So" 3177 ], 3178 dayOfWeek: [ 3179 "Dumengia", "Glindesdi", "Mardi", "Mesemna", "Gievgia", "Venderdi", "Sonda" 3180 ] 3181 }, 3182 ka: { // Georgian 3183 months: [ 3184 'áááááá á', 'ááááá áááá', 'ááá á¢á', 'ááá ááá', 'áááá¡á', 'ááááá¡á', 'ááááá¡á', 'ááááá¡á¢á', 'á¡áá¥á¢ááááá á', 'áá¥á¢ááááá á', 'ááááááá á', 'áááááááá á' 3185 ], 3186 dayOfWeekShort: [ 3187 "áá", "áá á¨", "á¡ááá¨", "ááá®", "á®á£á", "ááá ", "á¨áá" 3188 ], 3189 dayOfWeek: ["áááá á", "áá á¨ááááá", "á¡ááá¨ááááá", "ááá®á¨ááááá", "á®á£áá¨ááááá", "ááá áá¡áááá", "á¨ááááá"] 3190 } 3191 }, 3192 3193 ownerDocument: document, 3194 contentWindow: window, 3195 3196 value: '', 3197 rtl: false, 3198 3199 format: 'Y/m/d H:i', 3200 formatTime: 'H:i', 3201 formatDate: 'Y/m/d', 3202 3203 startDate: false, // new Date(), '1986/12/08', '-1970/01/05','-1970/01/05', 3204 step: 60, 3205 monthChangeSpinner: true, 3206 3207 closeOnDateSelect: false, 3208 closeOnTimeSelect: true, 3209 closeOnWithoutClick: true, 3210 closeOnInputClick: true, 3211 openOnFocus: true, 3212 3213 timepicker: true, 3214 datepicker: true, 3215 weeks: false, 3216 3217 defaultTime: false, // use formatTime format (ex. '10:00' for formatTime: 'H:i') 3218 defaultDate: false, // use formatDate format (ex new Date() or '1986/12/08' or '-1970/01/05' or '-1970/01/05') 3219 3220 minDate: false, 3221 maxDate: false, 3222 minTime: false, 3223 maxTime: false, 3224 minDateTime: false, 3225 maxDateTime: false, 3226 3227 allowTimes: [], 3228 opened: false, 3229 initTime: true, 3230 inline: false, 3231 theme: '', 3232 touchMovedThreshold: 5, 3233 3234 onSelectDate: function () {}, 3235 onSelectTime: function () {}, 3236 onChangeMonth: function () {}, 3237 onGetWeekOfYear: function () {}, 3238 onChangeYear: function () {}, 3239 onChangeDateTime: function () {}, 3240 onShow: function () {}, 3241 onClose: function () {}, 3242 onGenerate: function () {}, 3243 3244 withoutCopyright: true, 3245 inverseButton: false, 3246 hours12: false, 3247 next: 'xdsoft_next', 3248 prev : 'xdsoft_prev', 3249 dayOfWeekStart: 0, 3250 parentID: 'body', 3251 timeHeightInTimePicker: 25, 3252 timepickerScrollbar: true, 3253 todayButton: true, 3254 prevButton: true, 3255 nextButton: true, 3256 defaultSelect: true, 3257 3258 scrollMonth: true, 3259 scrollTime: true, 3260 scrollInput: true, 3261 3262 lazyInit: false, 3263 mask: false, 3264 validateOnBlur: true, 3265 allowBlank: true, 3266 yearStart: 1950, 3267 yearEnd: 2050, 3268 monthStart: 0, 3269 monthEnd: 11, 3270 style: '', 3271 id: '', 3272 fixed: false, 3273 roundTime: 'round', // ceil, floor 3274 className: '', 3275 weekends: [], 3276 highlightedDates: [], 3277 highlightedPeriods: [], 3278 allowDates : [], 3279 allowDateRe : null, 3280 disabledDates : [], 3281 disabledWeekDays: [], 3282 yearOffset: 0, 3283 beforeShowDay: null, 3284 3285 enterLikeTab: true, 3286 showApplyButton: false 3287 }; 3288 3289 var dateHelper = null, 3290 defaultDateHelper = null, 3291 globalLocaleDefault = 'en', 3292 globalLocale = 'en'; 3293 3294 var dateFormatterOptionsDefault = { 3295 meridiem: ['AM', 'PM'] 3296 }; 3297 3298 var initDateFormatter = function(){ 3299 var locale = default_options.i18n[globalLocale], 3300 opts = { 3301 days: locale.dayOfWeek, 3302 daysShort: locale.dayOfWeekShort, 3303 months: locale.months, 3304 monthsShort: $.map(locale.months, function(n){ return n.substring(0, 3) }) 3305 }; 3306 3307 if (typeof DateFormatter === 'function') { 3308 dateHelper = defaultDateHelper = new DateFormatter({ 3309 dateSettings: $.extend({}, dateFormatterOptionsDefault, opts) 3310 }); 3311 } 3312 }; 3313 3314 var dateFormatters = { 3315 moment: { 3316 default_options:{ 3317 format: 'YYYY/MM/DD HH:mm', 3318 formatDate: 'YYYY/MM/DD', 3319 formatTime: 'HH:mm', 3320 }, 3321 formatter: { 3322 parseDate: function (date, format) { 3323 if(isFormatStandard(format)){ 3324 return defaultDateHelper.parseDate(date, format); 3325 } 3326 var d = moment(date, format); 3327 return d.isValid() ? d.toDate() : false; 3328 }, 3329 3330 formatDate: function (date, format) { 3331 if(isFormatStandard(format)){ 3332 return defaultDateHelper.formatDate(date, format); 3333 } 3334 return moment(date).format(format); 3335 }, 3336 3337 formatMask: function(format){ 3338 return format 3339 .replace(/Y{4}/g, '9999') 3340 .replace(/Y{2}/g, '99') 3341 .replace(/M{2}/g, '19') 3342 .replace(/D{2}/g, '39') 3343 .replace(/H{2}/g, '29') 3344 .replace(/m{2}/g, '59') 3345 .replace(/s{2}/g, '59'); 3346 }, 3347 } 3348 } 3349 } 3350 3351 // for locale settings 3352 $.datetimepicker = { 3353 setLocale: function(locale){ 3354 var newLocale = default_options.i18n[locale] ? locale : globalLocaleDefault; 3355 if (globalLocale !== newLocale) { 3356 globalLocale = newLocale; 3357 // reinit date formatter 3358 initDateFormatter(); 3359 } 3360 }, 3361 3362 setDateFormatter: function(dateFormatter) { 3363 if(typeof dateFormatter === 'string' && dateFormatters.hasOwnProperty(dateFormatter)){ 3364 var df = dateFormatters[dateFormatter]; 3365 $.extend(default_options, df.default_options); 3366 dateHelper = df.formatter; 3367 } 3368 else { 3369 dateHelper = dateFormatter; 3370 } 3371 }, 3372 }; 3373 3374 var standardFormats = { 3375 RFC_2822: 'D, d M Y H:i:s O', 3376 ATOM: 'Y-m-d\TH:i:sP', 3377 ISO_8601: 'Y-m-d\TH:i:sO', 3378 RFC_822: 'D, d M y H:i:s O', 3379 RFC_850: 'l, d-M-y H:i:s T', 3380 RFC_1036: 'D, d M y H:i:s O', 3381 RFC_1123: 'D, d M Y H:i:s O', 3382 RSS: 'D, d M Y H:i:s O', 3383 W3C: 'Y-m-d\TH:i:sP' 3384 } 3385 3386 var isFormatStandard = function(format){ 3387 return $.map(standardFormats, function (val) { return val }) 3388 .indexOf(format) === -1 ? false : true; 3389 } 3390 3391 $.extend($.datetimepicker, standardFormats); 3392 3393 // first init date formatter 3394 initDateFormatter(); 3395 3396 // fix for ie8 3397 if (!window.getComputedStyle) { 3398 window.getComputedStyle = function (el) { 3399 this.el = el; 3400 this.getPropertyValue = function (prop) { 3401 var re = /(-([a-z]))/g; 3402 if (prop === 'float') { 3403 prop = 'styleFloat'; 3404 } 3405 if (re.test(prop)) { 3406 prop = prop.replace(re, function (a, b, c) { 3407 return c.toUpperCase(); 3408 }); 3409 } 3410 return el.currentStyle[prop] || null; 3411 }; 3412 return this; 3413 }; 3414 } 3415 if (!Array.prototype.indexOf) { 3416 Array.prototype.indexOf = function (obj, start) { 3417 var i, j; 3418 for (i = (start || 0), j = this.length; i < j; i += 1) { 3419 if (this[i] === obj) { return i; } 3420 } 3421 return -1; 3422 }; 3423 } 3424 3425 Date.prototype.countDaysInMonth = function () { 3426 return new Date(this.getFullYear(), this.getMonth() + 1, 0).getDate(); 3427 }; 3428 3429 $.fn.xdsoftScroller = function (options, percent) { 3430 return this.each(function () { 3431 var timeboxparent = $(this), 3432 pointerEventToXY = function (e) { 3433 var out = {x: 0, y: 0}, 3434 touch; 3435 if (e.type === 'touchstart' || e.type === 'touchmove' || e.type === 'touchend' || e.type === 'touchcancel') { 3436 touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0]; 3437 out.x = touch.clientX; 3438 out.y = touch.clientY; 3439 } else if (e.type === 'mousedown' || e.type === 'mouseup' || e.type === 'mousemove' || e.type === 'mouseover' || e.type === 'mouseout' || e.type === 'mouseenter' || e.type === 'mouseleave') { 3440 out.x = e.clientX; 3441 out.y = e.clientY; 3442 } 3443 return out; 3444 }, 3445 timebox, 3446 parentHeight, 3447 height, 3448 scrollbar, 3449 scroller, 3450 maximumOffset = 100, 3451 start = false, 3452 startY = 0, 3453 startTop = 0, 3454 h1 = 0, 3455 touchStart = false, 3456 startTopScroll = 0, 3457 calcOffset = function () {}; 3458 3459 if (percent === 'hide') { 3460 timeboxparent.find('.xdsoft_scrollbar').hide(); 3461 return; 3462 } 3463 3464 if (!$(this).hasClass('xdsoft_scroller_box')) { 3465 timebox = timeboxparent.children().eq(0); 3466 parentHeight = timeboxparent[0].clientHeight; 3467 height = timebox[0].offsetHeight; 3468 scrollbar = $('<div class="xdsoft_scrollbar"></div>'); 3469 scroller = $('<div class="xdsoft_scroller"></div>'); 3470 scrollbar.append(scroller); 3471 3472 timeboxparent.addClass('xdsoft_scroller_box').append(scrollbar); 3473 calcOffset = function calcOffset(event) { 3474 var offset = pointerEventToXY(event).y - startY + startTopScroll; 3475 if (offset < 0) { 3476 offset = 0; 3477 } 3478 if (offset + scroller[0].offsetHeight > h1) { 3479 offset = h1 - scroller[0].offsetHeight; 3480 } 3481 timeboxparent.trigger('scroll_element.xdsoft_scroller', [maximumOffset ? offset / maximumOffset : 0]); 3482 }; 3483 3484 scroller 3485 .on('touchstart.xdsoft_scroller mousedown.xdsoft_scroller', function (event) { 3486 if (!parentHeight) { 3487 timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percent]); 3488 } 3489 3490 startY = pointerEventToXY(event).y; 3491 startTopScroll = parseInt(scroller.css('margin-top'), 10); 3492 h1 = scrollbar[0].offsetHeight; 3493 3494 if (event.type === 'mousedown' || event.type === 'touchstart') { 3495 if (options.ownerDocument) { 3496 $(options.ownerDocument.body).addClass('xdsoft_noselect'); 3497 } 3498 $([options.ownerDocument.body, options.contentWindow]).on('touchend mouseup.xdsoft_scroller', function arguments_callee() { 3499 $([options.ownerDocument.body, options.contentWindow]).off('touchend mouseup.xdsoft_scroller', arguments_callee) 3500 .off('mousemove.xdsoft_scroller', calcOffset) 3501 .removeClass('xdsoft_noselect'); 3502 }); 3503 $(options.ownerDocument.body).on('mousemove.xdsoft_scroller', calcOffset); 3504 } else { 3505 touchStart = true; 3506 event.stopPropagation(); 3507 event.preventDefault(); 3508 } 3509 }) 3510 .on('touchmove', function (event) { 3511 if (touchStart) { 3512 event.preventDefault(); 3513 calcOffset(event); 3514 } 3515 }) 3516 .on('touchend touchcancel', function () { 3517 touchStart = false; 3518 startTopScroll = 0; 3519 }); 3520 3521 timeboxparent 3522 .on('scroll_element.xdsoft_scroller', function (event, percentage) { 3523 if (!parentHeight) { 3524 timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percentage, true]); 3525 } 3526 percentage = percentage > 1 ? 1 : (percentage < 0 || isNaN(percentage)) ? 0 : percentage; 3527 3528 scroller.css('margin-top', maximumOffset * percentage); 3529 3530 setTimeout(function () { 3531 timebox.css('marginTop', -parseInt((timebox[0].offsetHeight - parentHeight) * percentage, 10)); 3532 }, 10); 3533 }) 3534 .on('resize_scroll.xdsoft_scroller', function (event, percentage, noTriggerScroll) { 3535 var percent, sh; 3536 parentHeight = timeboxparent[0].clientHeight; 3537 height = timebox[0].offsetHeight; 3538 percent = parentHeight / height; 3539 sh = percent * scrollbar[0].offsetHeight; 3540 if (percent > 1) { 3541 scroller.hide(); 3542 } else { 3543 scroller.show(); 3544 scroller.css('height', parseInt(sh > 10 ? sh : 10, 10)); 3545 maximumOffset = scrollbar[0].offsetHeight - scroller[0].offsetHeight; 3546 if (noTriggerScroll !== true) { 3547 timeboxparent.trigger('scroll_element.xdsoft_scroller', [percentage || Math.abs(parseInt(timebox.css('marginTop'), 10)) / (height - parentHeight)]); 3548 } 3549 } 3550 });
vendor: 4,323 bytes, lines 3551-3678
3551 3552 timeboxparent.on('mousewheel', function (event) { 3553 var top = Math.abs(parseInt(timebox.css('marginTop'), 10)); 3554 3555 top = top - (event.deltaY * 20); 3556 if (top < 0) { 3557 top = 0; 3558 } 3559 3560 timeboxparent.trigger('scroll_element.xdsoft_scroller', [top / (height - parentHeight)]); 3561 event.stopPropagation(); 3562 return false; 3563 }); 3564 3565 timeboxparent.on('touchstart', function (event) { 3566 start = pointerEventToXY(event); 3567 startTop = Math.abs(parseInt(timebox.css('marginTop'), 10)); 3568 }); 3569 3570 timeboxparent.on('touchmove', function (event) { 3571 if (start) { 3572 event.preventDefault(); 3573 var coord = pointerEventToXY(event); 3574 timeboxparent.trigger('scroll_element.xdsoft_scroller', [(startTop - (coord.y - start.y)) / (height - parentHeight)]); 3575 } 3576 }); 3577 3578 timeboxparent.on('touchend touchcancel', function () { 3579 start = false; 3580 startTop = 0; 3581 }); 3582 } 3583 timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percent]); 3584 }); 3585 }; 3586 3587 $.fn.datetimepicker = function (opt, opt2) { 3588 var result = this, 3589 KEY0 = 48, 3590 KEY9 = 57, 3591 _KEY0 = 96, 3592 _KEY9 = 105, 3593 CTRLKEY = 17, 3594 DEL = 46, 3595 ENTER = 13, 3596 ESC = 27, 3597 BACKSPACE = 8, 3598 ARROWLEFT = 37, 3599 ARROWUP = 38, 3600 ARROWRIGHT = 39, 3601 ARROWDOWN = 40, 3602 TAB = 9, 3603 F5 = 116, 3604 AKEY = 65, 3605 CKEY = 67, 3606 VKEY = 86, 3607 ZKEY = 90, 3608 YKEY = 89, 3609 ctrlDown = false, 3610 options = ($.isPlainObject(opt) || !opt) ? $.extend(true, {}, default_options, opt) : $.extend(true, {}, default_options), 3611 3612 lazyInitTimer = 0, 3613 createDateTimePicker, 3614 destroyDateTimePicker, 3615 3616 lazyInit = function (input) { 3617 input 3618 .on('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', function initOnActionCallback() { 3619 if (input.is(':disabled') || input.data('xdsoft_datetimepicker')) { 3620 return; 3621 } 3622 clearTimeout(lazyInitTimer); 3623 lazyInitTimer = setTimeout(function () { 3624 3625 if (!input.data('xdsoft_datetimepicker')) { 3626 createDateTimePicker(input); 3627 } 3628 input 3629 .off('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', initOnActionCallback) 3630 .trigger('open.xdsoft'); 3631 }, 100); 3632 }); 3633 }; 3634 3635 createDateTimePicker = function (input) { 3636 var datetimepicker = $('<div class="xdsoft_datetimepicker xdsoft_noselect"></div>'), 3637 xdsoft_copyright = $('<div class="xdsoft_copyright"><a target="_blank" href="http://xdsoft.net/jqplugins/datetimepicker/">xdsoft.net</a></div>'), 3638 datepicker = $('<div class="xdsoft_datepicker active"></div>'), 3639 month_picker = $('<div class="xdsoft_monthpicker"><button type="button" class="xdsoft_prev"></button><button type="button" class="xdsoft_today_button"></button>' + 3640 '<div class="xdsoft_label xdsoft_month"><span></span><i></i></div>' + 3641 '<div class="xdsoft_label xdsoft_year"><span></span><i></i></div>' + 3642 '<button type="button" class="xdsoft_next"></button></div>'), 3643 calendar = $('<div class="xdsoft_calendar"></div>'), 3644 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>'), 3645 timeboxparent = timepicker.find('.xdsoft_time_box').eq(0), 3646 timebox = $('<div class="xdsoft_time_variant"></div>'), 3647 applyButton = $('<button type="button" class="xdsoft_save_selected blue-gradient-button">Save Selected</button>'), 3648 3649 monthselect = $('<div class="xdsoft_select xdsoft_monthselect"><div></div></div>'), 3650 yearselect = $('<div class="xdsoft_select xdsoft_yearselect"><div></div></div>'), 3651 triggerAfterOpen = false, 3652 XDSoft_datetime, 3653 3654 xchangeTimer, 3655 timerclick, 3656 current_time_index, 3657 setPos, 3658 timer = 0, 3659 _xdsoft_datetime, 3660 forEachAncestorOf; 3661 3662 if (options.id) { 3663 datetimepicker.attr('id', options.id); 3664 } 3665 if (options.style) { 3666 datetimepicker.attr('style', options.style); 3667 } 3668 if (options.weeks) { 3669 datetimepicker.addClass('xdsoft_showweeks'); 3670 } 3671 if (options.rtl) { 3672 datetimepicker.addClass('xdsoft_rtl'); 3673 } 3674 3675 datetimepicker.addClass('xdsoft_' + options.theme); 3676 datetimepicker.addClass(options.className); 3677 3678 month_picker
vendor: 10,033 bytes, lines 3679-3947
3679 .find('.xdsoft_month span') 3680 .after(monthselect); 3681 month_picker 3682 .find('.xdsoft_year span') 3683 .after(yearselect); 3684 3685 month_picker 3686 .find('.xdsoft_month,.xdsoft_year') 3687 .on('touchstart mousedown.xdsoft', function (event) { 3688 var select = $(this).find('.xdsoft_select').eq(0), 3689 val = 0, 3690 top = 0, 3691 visible = select.is(':visible'), 3692 items, 3693 i; 3694 3695 month_picker 3696 .find('.xdsoft_select') 3697 .hide(); 3698 if (_xdsoft_datetime.currentTime) { 3699 val = _xdsoft_datetime.currentTime[$(this).hasClass('xdsoft_month') ? 'getMonth' : 'getFullYear'](); 3700 } 3701 3702 select[visible ? 'hide' : 'show'](); 3703 for (items = select.find('div.xdsoft_option'), i = 0; i < items.length; i += 1) { 3704 if (items.eq(i).data('value') === val) { 3705 break; 3706 } else { 3707 top += items[0].offsetHeight; 3708 } 3709 } 3710 3711 select.xdsoftScroller(options, top / (select.children()[0].offsetHeight - (select[0].clientHeight))); 3712 event.stopPropagation(); 3713 return false; 3714 }); 3715 3716 var handleTouchMoved = function (event) { 3717 var evt = event.originalEvent; 3718 var touchPosition = evt.touches ? evt.touches[0] : evt; 3719 this.touchStartPosition = this.touchStartPosition || touchPosition; 3720 var xMovement = Math.abs(this.touchStartPosition.clientX - touchPosition.clientX); 3721 var yMovement = Math.abs(this.touchStartPosition.clientY - touchPosition.clientY); 3722 var distance = Math.sqrt(xMovement * xMovement + yMovement * yMovement); 3723 if(distance > options.touchMovedThreshold) { 3724 this.touchMoved = true; 3725 } 3726 } 3727 3728 month_picker 3729 .find('.xdsoft_select') 3730 .xdsoftScroller(options) 3731 .on('touchstart mousedown.xdsoft', function (event) { 3732 var evt = event.originalEvent; 3733 this.touchMoved = false; 3734 this.touchStartPosition = evt.touches ? evt.touches[0] : evt; 3735 event.stopPropagation(); 3736 event.preventDefault(); 3737 }) 3738 .on('touchmove', '.xdsoft_option', handleTouchMoved) 3739 .on('touchend mousedown.xdsoft', '.xdsoft_option', function () { 3740 if (!this.touchMoved) { 3741 if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null) { 3742 _xdsoft_datetime.currentTime = _xdsoft_datetime.now(); 3743 } 3744 3745 var year = _xdsoft_datetime.currentTime.getFullYear(); 3746 if (_xdsoft_datetime && _xdsoft_datetime.currentTime) { 3747 _xdsoft_datetime.currentTime[$(this).parent().parent().hasClass('xdsoft_monthselect') ? 'setMonth' : 'setFullYear']($(this).data('value')); 3748 } 3749 3750 $(this).parent().parent().hide(); 3751 3752 datetimepicker.trigger('xchange.xdsoft'); 3753 if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) { 3754 options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); 3755 } 3756 3757 if (year !== _xdsoft_datetime.currentTime.getFullYear() && $.isFunction(options.onChangeYear)) { 3758 options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); 3759 } 3760 } 3761 }); 3762 3763 datetimepicker.getValue = function () { 3764 return _xdsoft_datetime.getCurrentTime(); 3765 }; 3766 3767 datetimepicker.setOptions = function (_options) { 3768 var highlightedDates = {}; 3769 3770 options = $.extend(true, {}, options, _options); 3771 3772 if (_options.allowTimes && $.isArray(_options.allowTimes) && _options.allowTimes.length) { 3773 options.allowTimes = $.extend(true, [], _options.allowTimes); 3774 } 3775 3776 if (_options.weekends && $.isArray(_options.weekends) && _options.weekends.length) { 3777 options.weekends = $.extend(true, [], _options.weekends); 3778 } 3779 3780 if (_options.allowDates && $.isArray(_options.allowDates) && _options.allowDates.length) { 3781 options.allowDates = $.extend(true, [], _options.allowDates); 3782 } 3783 3784 if (_options.allowDateRe && Object.prototype.toString.call(_options.allowDateRe)==="[object String]") { 3785 options.allowDateRe = new RegExp(_options.allowDateRe); 3786 } 3787 3788 if (_options.highlightedDates && $.isArray(_options.highlightedDates) && _options.highlightedDates.length) { 3789 $.each(_options.highlightedDates, function (index, value) { 3790 var splitData = $.map(value.split(','), $.trim), 3791 exDesc, 3792 hDate = new HighlightedDate(dateHelper.parseDate(splitData[0], options.formatDate), splitData[1], splitData[2]), // date, desc, style 3793 keyDate = dateHelper.formatDate(hDate.date, options.formatDate); 3794 if (highlightedDates[keyDate] !== undefined) { 3795 exDesc = highlightedDates[keyDate].desc; 3796 if (exDesc && exDesc.length && hDate.desc && hDate.desc.length) { 3797 highlightedDates[keyDate].desc = exDesc + "\n" + hDate.desc; 3798 } 3799 } else { 3800 highlightedDates[keyDate] = hDate; 3801 } 3802 }); 3803 3804 options.highlightedDates = $.extend(true, [], highlightedDates); 3805 } 3806 3807 if (_options.highlightedPeriods && $.isArray(_options.highlightedPeriods) && _options.highlightedPeriods.length) { 3808 highlightedDates = $.extend(true, [], options.highlightedDates); 3809 $.each(_options.highlightedPeriods, function (index, value) { 3810 var dateTest, // start date 3811 dateEnd, 3812 desc, 3813 hDate, 3814 keyDate, 3815 exDesc, 3816 style; 3817 if ($.isArray(value)) { 3818 dateTest = value[0]; 3819 dateEnd = value[1]; 3820 desc = value[2]; 3821 style = value[3]; 3822 } 3823 else { 3824 var splitData = $.map(value.split(','), $.trim); 3825 dateTest = dateHelper.parseDate(splitData[0], options.formatDate); 3826 dateEnd = dateHelper.parseDate(splitData[1], options.formatDate); 3827 desc = splitData[2]; 3828 style = splitData[3]; 3829 } 3830 3831 while (dateTest <= dateEnd) { 3832 hDate = new HighlightedDate(dateTest, desc, style); 3833 keyDate = dateHelper.formatDate(dateTest, options.formatDate); 3834 dateTest.setDate(dateTest.getDate() + 1); 3835 if (highlightedDates[keyDate] !== undefined) { 3836 exDesc = highlightedDates[keyDate].desc; 3837 if (exDesc && exDesc.length && hDate.desc && hDate.desc.length) { 3838 highlightedDates[keyDate].desc = exDesc + "\n" + hDate.desc; 3839 } 3840 } else { 3841 highlightedDates[keyDate] = hDate; 3842 } 3843 } 3844 }); 3845 3846 options.highlightedDates = $.extend(true, [], highlightedDates); 3847 } 3848 3849 if (_options.disabledDates && $.isArray(_options.disabledDates) && _options.disabledDates.length) { 3850 options.disabledDates = $.extend(true, [], _options.disabledDates); 3851 } 3852 3853 if (_options.disabledWeekDays && $.isArray(_options.disabledWeekDays) && _options.disabledWeekDays.length) { 3854 options.disabledWeekDays = $.extend(true, [], _options.disabledWeekDays); 3855 } 3856 3857 if ((options.open || options.opened) && (!options.inline)) { 3858 input.trigger('open.xdsoft'); 3859 } 3860 3861 if (options.inline) { 3862 triggerAfterOpen = true; 3863 datetimepicker.addClass('xdsoft_inline'); 3864 input.after(datetimepicker).hide(); 3865 } 3866 3867 if (options.inverseButton) { 3868 options.next = 'xdsoft_prev'; 3869 options.prev = 'xdsoft_next'; 3870 } 3871 3872 if (options.datepicker) { 3873 datepicker.addClass('active'); 3874 } else { 3875 datepicker.removeClass('active'); 3876 } 3877 3878 if (options.timepicker) { 3879 timepicker.addClass('active'); 3880 } else { 3881 timepicker.removeClass('active'); 3882 } 3883 3884 if (options.value) { 3885 _xdsoft_datetime.setCurrentTime(options.value); 3886 if (input && input.val) { 3887 input.val(_xdsoft_datetime.str); 3888 } 3889 } 3890 3891 if (isNaN(options.dayOfWeekStart)) { 3892 options.dayOfWeekStart = 0; 3893 } else { 3894 options.dayOfWeekStart = parseInt(options.dayOfWeekStart, 10) % 7; 3895 } 3896 3897 if (!options.timepickerScrollbar) { 3898 timeboxparent.xdsoftScroller(options, 'hide'); 3899 } 3900 3901 if (options.minDate && /^[\+\-](.*)$/.test(options.minDate)) { 3902 options.minDate = dateHelper.formatDate(_xdsoft_datetime.strToDateTime(options.minDate), options.formatDate); 3903 } 3904 3905 if (options.maxDate && /^[\+\-](.*)$/.test(options.maxDate)) { 3906 options.maxDate = dateHelper.formatDate(_xdsoft_datetime.strToDateTime(options.maxDate), options.formatDate); 3907 } 3908 3909 if (options.minDateTime && /^\+(.*)$/.test(options.minDateTime)) { 3910 options.minDateTime = _xdsoft_datetime.strToDateTime(options.minDateTime).dateFormat(options.formatDate); 3911 } 3912 3913 if (options.maxDateTime && /^\+(.*)$/.test(options.maxDateTime)) { 3914 options.maxDateTime = _xdsoft_datetime.strToDateTime(options.maxDateTime).dateFormat(options.formatDate); 3915 } 3916 3917 applyButton.toggle(options.showApplyButton); 3918 3919 month_picker 3920 .find('.xdsoft_today_button') 3921 .css('visibility', !options.todayButton ? 'hidden' : 'visible'); 3922 3923 month_picker 3924 .find('.' + options.prev) 3925 .css('visibility', !options.prevButton ? 'hidden' : 'visible'); 3926 3927 month_picker 3928 .find('.' + options.next) 3929 .css('visibility', !options.nextButton ? 'hidden' : 'visible'); 3930 3931 setMask(options); 3932 3933 if (options.validateOnBlur) { 3934 input 3935 .off('blur.xdsoft') 3936 .on('blur.xdsoft', function () { 3937 if (options.allowBlank && (!$.trim($(this).val()).length || 3938 (typeof options.mask === "string" && $.trim($(this).val()) === options.mask.replace(/[0-9]/g, '_')))) { 3939 $(this).val(null); 3940 datetimepicker.data('xdsoft_datetime').empty(); 3941 } else { 3942 var d = dateHelper.parseDate($(this).val(), options.format); 3943 if (d) { // parseDate() may skip some invalid parts like date or time, so make it clear for user: show parsed date/time 3944 $(this).val(dateHelper.formatDate(d, options.format)); 3945 } else { 3946 var splittedHours = +([$(this).val()[0], $(this).val()[1]].join('')), 3947 splittedMinutes = +([$(this).val()[2], $(this).val()[3]].join(''));
vendor: 4,566 bytes, lines 3948-4105
3948 3949 // parse the numbers as 0312 => 03:12 3950 if (!options.datepicker && options.timepicker && splittedHours >= 0 && splittedHours < 24 && splittedMinutes >= 0 && splittedMinutes < 60) { 3951 $(this).val([splittedHours, splittedMinutes].map(function (item) { 3952 return item > 9 ? item : '0' + item; 3953 }).join(':')); 3954 } else { 3955 $(this).val(dateHelper.formatDate(_xdsoft_datetime.now(), options.format)); 3956 } 3957 } 3958 datetimepicker.data('xdsoft_datetime').setCurrentTime($(this).val()); 3959 } 3960 3961 datetimepicker.trigger('changedatetime.xdsoft'); 3962 datetimepicker.trigger('close.xdsoft'); 3963 }); 3964 } 3965 options.dayOfWeekStartPrev = (options.dayOfWeekStart === 0) ? 6 : options.dayOfWeekStart - 1; 3966 3967 datetimepicker 3968 .trigger('xchange.xdsoft') 3969 .trigger('afterOpen.xdsoft'); 3970 }; 3971 3972 datetimepicker 3973 .data('options', options) 3974 .on('touchstart mousedown.xdsoft', function (event) { 3975 event.stopPropagation(); 3976 event.preventDefault(); 3977 yearselect.hide(); 3978 monthselect.hide(); 3979 return false; 3980 }); 3981 3982 //scroll_element = timepicker.find('.xdsoft_time_box'); 3983 timeboxparent.append(timebox); 3984 timeboxparent.xdsoftScroller(options); 3985 3986 datetimepicker.on('afterOpen.xdsoft', function () { 3987 timeboxparent.xdsoftScroller(options); 3988 }); 3989 3990 datetimepicker 3991 .append(datepicker) 3992 .append(timepicker); 3993 3994 if (options.withoutCopyright !== true) { 3995 datetimepicker 3996 .append(xdsoft_copyright); 3997 } 3998 3999 datepicker 4000 .append(month_picker) 4001 .append(calendar) 4002 .append(applyButton); 4003 4004 $(options.parentID) 4005 .append(datetimepicker); 4006 4007 XDSoft_datetime = function () { 4008 var _this = this; 4009 _this.now = function (norecursion) { 4010 var d = new Date(), 4011 date, 4012 time; 4013 4014 if (!norecursion && options.defaultDate) { 4015 date = _this.strToDateTime(options.defaultDate); 4016 d.setFullYear(date.getFullYear()); 4017 d.setMonth(date.getMonth()); 4018 d.setDate(date.getDate()); 4019 } 4020 4021 d.setFullYear(d.getFullYear()); 4022 4023 if (!norecursion && options.defaultTime) { 4024 time = _this.strtotime(options.defaultTime); 4025 d.setHours(time.getHours()); 4026 d.setMinutes(time.getMinutes()); 4027 d.setSeconds(time.getSeconds()); 4028 d.setMilliseconds(time.getMilliseconds()); 4029 } 4030 return d; 4031 }; 4032 4033 _this.isValidDate = function (d) { 4034 if (Object.prototype.toString.call(d) !== "[object Date]") { 4035 return false; 4036 } 4037 return !isNaN(d.getTime()); 4038 }; 4039 4040 _this.setCurrentTime = function (dTime, requireValidDate) { 4041 if (typeof dTime === 'string') { 4042 _this.currentTime = _this.strToDateTime(dTime); 4043 } 4044 else if (_this.isValidDate(dTime)) { 4045 _this.currentTime = dTime; 4046 } 4047 else if (!dTime && !requireValidDate && options.allowBlank && !options.inline) { 4048 _this.currentTime = null; 4049 } 4050 else { 4051 _this.currentTime = _this.now(); 4052 } 4053 4054 datetimepicker.trigger('xchange.xdsoft'); 4055 }; 4056 4057 _this.empty = function () { 4058 _this.currentTime = null; 4059 }; 4060 4061 _this.getCurrentTime = function () { 4062 return _this.currentTime; 4063 }; 4064 4065 _this.nextMonth = function () { 4066 4067 if (_this.currentTime === undefined || _this.currentTime === null) { 4068 _this.currentTime = _this.now(); 4069 } 4070 4071 var month = _this.currentTime.getMonth() + 1, 4072 year; 4073 if (month === 12) { 4074 _this.currentTime.setFullYear(_this.currentTime.getFullYear() + 1); 4075 month = 0; 4076 } 4077 4078 year = _this.currentTime.getFullYear(); 4079 4080 _this.currentTime.setDate( 4081 Math.min( 4082 new Date(_this.currentTime.getFullYear(), month + 1, 0).getDate(), 4083 _this.currentTime.getDate() 4084 ) 4085 ); 4086 _this.currentTime.setMonth(month); 4087 4088 if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) { 4089 options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); 4090 } 4091 4092 if (year !== _this.currentTime.getFullYear() && $.isFunction(options.onChangeYear)) { 4093 options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); 4094 } 4095 4096 datetimepicker.trigger('xchange.xdsoft'); 4097 return month; 4098 }; 4099 4100 _this.prevMonth = function () { 4101 4102 if (_this.currentTime === undefined || _this.currentTime === null) { 4103 _this.currentTime = _this.now(); 4104 } 4105
vendor: 27,152 bytes, lines 4106-4819
4106 var month = _this.currentTime.getMonth() - 1; 4107 if (month === -1) { 4108 _this.currentTime.setFullYear(_this.currentTime.getFullYear() - 1); 4109 month = 11; 4110 } 4111 _this.currentTime.setDate( 4112 Math.min( 4113 new Date(_this.currentTime.getFullYear(), month + 1, 0).getDate(), 4114 _this.currentTime.getDate() 4115 ) 4116 ); 4117 _this.currentTime.setMonth(month); 4118 if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) { 4119 options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); 4120 } 4121 datetimepicker.trigger('xchange.xdsoft'); 4122 return month; 4123 }; 4124 4125 _this.getWeekOfYear = function (datetime) { 4126 if (options.onGetWeekOfYear && $.isFunction(options.onGetWeekOfYear)) { 4127 var week = options.onGetWeekOfYear.call(datetimepicker, datetime); 4128 if (typeof week !== 'undefined') { 4129 return week; 4130 } 4131 } 4132 var onejan = new Date(datetime.getFullYear(), 0, 1); 4133 4134 //First week of the year is th one with the first Thursday according to ISO8601 4135 if (onejan.getDay() !== 4) { 4136 onejan.setMonth(0, 1 + ((4 - onejan.getDay()+ 7) % 7)); 4137 } 4138 4139 return Math.ceil((((datetime - onejan) / 86400000) + onejan.getDay() + 1) / 7); 4140 }; 4141 4142 _this.strToDateTime = function (sDateTime) { 4143 var tmpDate = [], timeOffset, currentTime; 4144 4145 if (sDateTime && sDateTime instanceof Date && _this.isValidDate(sDateTime)) { 4146 return sDateTime; 4147 } 4148 4149 tmpDate = /^([+-]{1})(.*)$/.exec(sDateTime); 4150 4151 if (tmpDate) { 4152 tmpDate[2] = dateHelper.parseDate(tmpDate[2], options.formatDate); 4153 } 4154 4155 if (tmpDate && tmpDate[2]) { 4156 timeOffset = tmpDate[2].getTime() - (tmpDate[2].getTimezoneOffset()) * 60000; 4157 currentTime = new Date((_this.now(true)).getTime() + parseInt(tmpDate[1] + '1', 10) * timeOffset); 4158 } else { 4159 currentTime = sDateTime ? dateHelper.parseDate(sDateTime, options.format) : _this.now(); 4160 } 4161 4162 if (!_this.isValidDate(currentTime)) { 4163 currentTime = _this.now(); 4164 } 4165 4166 return currentTime; 4167 }; 4168 4169 _this.strToDate = function (sDate) { 4170 if (sDate && sDate instanceof Date && _this.isValidDate(sDate)) { 4171 return sDate; 4172 } 4173 4174 var currentTime = sDate ? dateHelper.parseDate(sDate, options.formatDate) : _this.now(true); 4175 if (!_this.isValidDate(currentTime)) { 4176 currentTime = _this.now(true); 4177 } 4178 return currentTime; 4179 }; 4180 4181 _this.strtotime = function (sTime) { 4182 if (sTime && sTime instanceof Date && _this.isValidDate(sTime)) { 4183 return sTime; 4184 } 4185 var currentTime = sTime ? dateHelper.parseDate(sTime, options.formatTime) : _this.now(true); 4186 if (!_this.isValidDate(currentTime)) { 4187 currentTime = _this.now(true); 4188 } 4189 return currentTime; 4190 }; 4191 4192 _this.str = function () { 4193 var format = options.format; 4194 if (options.yearOffset) { 4195 format = format.replace('Y', _this.currentTime.getFullYear() + options.yearOffset); 4196 format = format.replace('y', String(_this.currentTime.getFullYear() + options.yearOffset).substring(2, 4)); 4197 } 4198 return dateHelper.formatDate(_this.currentTime, format); 4199 }; 4200 _this.currentTime = this.now(); 4201 }; 4202 4203 _xdsoft_datetime = new XDSoft_datetime(); 4204 4205 applyButton.on('touchend click', function (e) {//pathbrite 4206 e.preventDefault(); 4207 datetimepicker.data('changed', true); 4208 _xdsoft_datetime.setCurrentTime(getCurrentValue()); 4209 input.val(_xdsoft_datetime.str()); 4210 datetimepicker.trigger('close.xdsoft'); 4211 }); 4212 month_picker 4213 .find('.xdsoft_today_button') 4214 .on('touchend mousedown.xdsoft', function () { 4215 datetimepicker.data('changed', true); 4216 _xdsoft_datetime.setCurrentTime(0, true); 4217 datetimepicker.trigger('afterOpen.xdsoft'); 4218 }).on('dblclick.xdsoft', function () { 4219 var currentDate = _xdsoft_datetime.getCurrentTime(), minDate, maxDate; 4220 currentDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate()); 4221 minDate = _xdsoft_datetime.strToDate(options.minDate); 4222 minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()); 4223 if (currentDate < minDate) { 4224 return; 4225 } 4226 maxDate = _xdsoft_datetime.strToDate(options.maxDate); 4227 maxDate = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()); 4228 if (currentDate > maxDate) { 4229 return; 4230 } 4231 input.val(_xdsoft_datetime.str()); 4232 input.trigger('change'); 4233 datetimepicker.trigger('close.xdsoft'); 4234 }); 4235 month_picker 4236 .find('.xdsoft_prev,.xdsoft_next') 4237 .on('touchend mousedown.xdsoft', function () { 4238 var $this = $(this), 4239 timer = 0, 4240 stop = false; 4241 4242 (function arguments_callee1(v) { 4243 if ($this.hasClass(options.next)) { 4244 _xdsoft_datetime.nextMonth(); 4245 } else if ($this.hasClass(options.prev)) { 4246 _xdsoft_datetime.prevMonth(); 4247 } 4248 if (options.monthChangeSpinner) { 4249 if (!stop) { 4250 timer = setTimeout(arguments_callee1, v || 100); 4251 } 4252 } 4253 }(500)); 4254 4255 $([options.ownerDocument.body, options.contentWindow]).on('touchend mouseup.xdsoft', function arguments_callee2() { 4256 clearTimeout(timer); 4257 stop = true; 4258 $([options.ownerDocument.body, options.contentWindow]).off('touchend mouseup.xdsoft', arguments_callee2); 4259 }); 4260 }); 4261 4262 timepicker 4263 .find('.xdsoft_prev,.xdsoft_next') 4264 .on('touchend mousedown.xdsoft', function () { 4265 var $this = $(this), 4266 timer = 0, 4267 stop = false, 4268 period = 110; 4269 (function arguments_callee4(v) { 4270 var pheight = timeboxparent[0].clientHeight, 4271 height = timebox[0].offsetHeight, 4272 top = Math.abs(parseInt(timebox.css('marginTop'), 10)); 4273 if ($this.hasClass(options.next) && (height - pheight) - options.timeHeightInTimePicker >= top) { 4274 timebox.css('marginTop', '-' + (top + options.timeHeightInTimePicker) + 'px'); 4275 } else if ($this.hasClass(options.prev) && top - options.timeHeightInTimePicker >= 0) { 4276 timebox.css('marginTop', '-' + (top - options.timeHeightInTimePicker) + 'px'); 4277 } 4278 /** 4279 * Fixed bug: 4280 * When using css3 transition, it will cause a bug that you cannot scroll the timepicker list. 4281 * The reason is that the transition-duration time, if you set it to 0, all things fine, otherwise, this 4282 * would cause a bug when you use jquery.css method. 4283 * Let's say: * { transition: all .5s ease; } 4284 * jquery timebox.css('marginTop') will return the original value which is before you clicking the next/prev button, 4285 * meanwhile the timebox[0].style.marginTop will return the right value which is after you clicking the 4286 * next/prev button. 4287 * 4288 * What we should do: 4289 * Replace timebox.css('marginTop') with timebox[0].style.marginTop. 4290 */ 4291 timeboxparent.trigger('scroll_element.xdsoft_scroller', [Math.abs(parseInt(timebox[0].style.marginTop, 10) / (height - pheight))]); 4292 period = (period > 10) ? 10 : period - 10; 4293 if (!stop) { 4294 timer = setTimeout(arguments_callee4, v || period); 4295 } 4296 }(500)); 4297 $([options.ownerDocument.body, options.contentWindow]).on('touchend mouseup.xdsoft', function arguments_callee5() { 4298 clearTimeout(timer); 4299 stop = true; 4300 $([options.ownerDocument.body, options.contentWindow]) 4301 .off('touchend mouseup.xdsoft', arguments_callee5); 4302 }); 4303 }); 4304 4305 xchangeTimer = 0; 4306 // base handler - generating a calendar and timepicker 4307 datetimepicker 4308 .on('xchange.xdsoft', function (event) { 4309 clearTimeout(xchangeTimer); 4310 xchangeTimer = setTimeout(function () { 4311 4312 if (_xdsoft_datetime.currentTime === undefined || _xdsoft_datetime.currentTime === null) { 4313 _xdsoft_datetime.currentTime = _xdsoft_datetime.now(); 4314 } 4315 4316 var table = '', 4317 start = new Date(_xdsoft_datetime.currentTime.getFullYear(), _xdsoft_datetime.currentTime.getMonth(), 1, 12, 0, 0), 4318 i = 0, 4319 j, 4320 today = _xdsoft_datetime.now(), 4321 maxDate = false, 4322 minDate = false, 4323 minDateTime = false, 4324 maxDateTime = false, 4325 hDate, 4326 day, 4327 d, 4328 y, 4329 m, 4330 w, 4331 classes = [], 4332 customDateSettings, 4333 newRow = true, 4334 time = '', 4335 h, 4336 line_time, 4337 description; 4338 4339 while (start.getDay() !== options.dayOfWeekStart) { 4340 start.setDate(start.getDate() - 1); 4341 } 4342 4343 table += '<table><thead><tr>'; 4344 4345 if (options.weeks) { 4346 table += '<th></th>'; 4347 } 4348 4349 for (j = 0; j < 7; j += 1) { 4350 table += '<th>' + options.i18n[globalLocale].dayOfWeekShort[(j + options.dayOfWeekStart) % 7] + '</th>'; 4351 } 4352 4353 table += '</tr></thead>'; 4354 table += '<tbody>'; 4355 4356 if (options.maxDate !== false) { 4357 maxDate = _xdsoft_datetime.strToDate(options.maxDate); 4358 maxDate = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate(), 23, 59, 59, 999); 4359 } 4360 4361 if (options.minDate !== false) { 4362 minDate = _xdsoft_datetime.strToDate(options.minDate); 4363 minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()); 4364 } 4365 4366 if (options.minDateTime !== false) { 4367 minDateTime = _xdsoft_datetime.strToDate(options.minDateTime); 4368 minDateTime = new Date(minDateTime.getFullYear(), minDateTime.getMonth(), minDateTime.getDate(), minDateTime.getHours(), minDateTime.getMinutes(), minDateTime.getSeconds()); 4369 } 4370 4371 if (options.maxDateTime !== false) { 4372 maxDateTime = _xdsoft_datetime.strToDate(options.maxDateTime); 4373 maxDateTime = new Date(maxDateTime.getFullYear(), maxDateTime.getMonth(), maxDateTime.getDate(), maxDateTime.getHours(), maxDateTime.getMinutes(), maxDateTime.getSeconds()); 4374 } 4375 4376 var maxDateTimeDay; 4377 if (maxDateTime !== false) { 4378 maxDateTimeDay = ((maxDateTime.getFullYear() * 12) + maxDateTime.getMonth()) * 31 + maxDateTime.getDate(); 4379 } 4380 4381 while (i < _xdsoft_datetime.currentTime.countDaysInMonth() || start.getDay() !== options.dayOfWeekStart || _xdsoft_datetime.currentTime.getMonth() === start.getMonth()) { 4382 classes = []; 4383 i += 1; 4384 4385 day = start.getDay(); 4386 d = start.getDate(); 4387 y = start.getFullYear(); 4388 m = start.getMonth(); 4389 w = _xdsoft_datetime.getWeekOfYear(start); 4390 description = ''; 4391 4392 classes.push('xdsoft_date'); 4393 4394 if (options.beforeShowDay && $.isFunction(options.beforeShowDay.call)) { 4395 customDateSettings = options.beforeShowDay.call(datetimepicker, start); 4396 } else { 4397 customDateSettings = null; 4398 } 4399 4400 if(options.allowDateRe && Object.prototype.toString.call(options.allowDateRe) === "[object RegExp]"){ 4401 if(!options.allowDateRe.test(dateHelper.formatDate(start, options.formatDate))){ 4402 classes.push('xdsoft_disabled'); 4403 } 4404 } 4405 4406 if(options.allowDates && options.allowDates.length>0){ 4407 if(options.allowDates.indexOf(dateHelper.formatDate(start, options.formatDate)) === -1){ 4408 classes.push('xdsoft_disabled'); 4409 } 4410 } 4411 4412 var currentDay = ((start.getFullYear() * 12) + start.getMonth()) * 31 + start.getDate(); 4413 if ((maxDate !== false && start > maxDate) || (minDateTime !== false && start < minDateTime) || (minDate !== false && start < minDate) || (maxDateTime !== false && currentDay > maxDateTimeDay) || (customDateSettings && customDateSettings[0] === false)) { 4414 classes.push('xdsoft_disabled'); 4415 } 4416 4417 if (options.disabledDates.indexOf(dateHelper.formatDate(start, options.formatDate)) !== -1) { 4418 classes.push('xdsoft_disabled'); 4419 } 4420 4421 if (options.disabledWeekDays.indexOf(day) !== -1) { 4422 classes.push('xdsoft_disabled'); 4423 } 4424 4425 if (input.is('[disabled]')) { 4426 classes.push('xdsoft_disabled'); 4427 } 4428 4429 if (customDateSettings && customDateSettings[1] !== "") { 4430 classes.push(customDateSettings[1]); 4431 } 4432 4433 if (_xdsoft_datetime.currentTime.getMonth() !== m) { 4434 classes.push('xdsoft_other_month'); 4435 } 4436 4437 if ((options.defaultSelect || datetimepicker.data('changed')) && dateHelper.formatDate(_xdsoft_datetime.currentTime, options.formatDate) === dateHelper.formatDate(start, options.formatDate)) { 4438 classes.push('xdsoft_current'); 4439 } 4440 4441 if (dateHelper.formatDate(today, options.formatDate) === dateHelper.formatDate(start, options.formatDate)) { 4442 classes.push('xdsoft_today'); 4443 } 4444 4445 if (start.getDay() === 0 || start.getDay() === 6 || options.weekends.indexOf(dateHelper.formatDate(start, options.formatDate)) !== -1) { 4446 classes.push('xdsoft_weekend'); 4447 } 4448 4449 if (options.highlightedDates[dateHelper.formatDate(start, options.formatDate)] !== undefined) { 4450 hDate = options.highlightedDates[dateHelper.formatDate(start, options.formatDate)]; 4451 classes.push(hDate.style === undefined ? 'xdsoft_highlighted_default' : hDate.style); 4452 description = hDate.desc === undefined ? '' : hDate.desc; 4453 } 4454 4455 if (options.beforeShowDay && $.isFunction(options.beforeShowDay)) { 4456 classes.push(options.beforeShowDay(start)); 4457 } 4458 4459 if (newRow) { 4460 table += '<tr>'; 4461 newRow = false; 4462 if (options.weeks) { 4463 table += '<th>' + w + '</th>'; 4464 } 4465 } 4466 4467 table += '<td data-date="' + d + '" data-month="' + m + '" data-year="' + y + '"' + ' class="xdsoft_date xdsoft_day_of_week' + start.getDay() + ' ' + classes.join(' ') + '" title="' + description + '">' + 4468 '<div>' + d + '</div>' + 4469 '</td>'; 4470 4471 if (start.getDay() === options.dayOfWeekStartPrev) { 4472 table += '</tr>'; 4473 newRow = true; 4474 } 4475 4476 start.setDate(d + 1); 4477 } 4478 table += '</tbody></table>'; 4479 4480 calendar.html(table); 4481 4482 month_picker.find('.xdsoft_label span').eq(0).text(options.i18n[globalLocale].months[_xdsoft_datetime.currentTime.getMonth()]); 4483 month_picker.find('.xdsoft_label span').eq(1).text(_xdsoft_datetime.currentTime.getFullYear() + options.yearOffset); 4484 4485 // generate timebox 4486 time = ''; 4487 h = ''; 4488 m = ''; 4489 4490 var minTimeMinutesOfDay = 0; 4491 if (options.minTime !== false) { 4492 var t = _xdsoft_datetime.strtotime(options.minTime); 4493 minTimeMinutesOfDay = 60 * t.getHours() + t.getMinutes(); 4494 } 4495 var maxTimeMinutesOfDay = 24 * 60; 4496 if (options.maxTime !== false) { 4497 var t = _xdsoft_datetime.strtotime(options.maxTime); 4498 maxTimeMinutesOfDay = 60 * t.getHours() + t.getMinutes(); 4499 } 4500 4501 if (options.minDateTime !== false) { 4502 var t = _xdsoft_datetime.strToDateTime(options.minDateTime); 4503 var currentDayIsMinDateTimeDay = dateHelper.formatDate(_xdsoft_datetime.currentTime, options.formatDate) === dateHelper.formatDate(t, options.formatDate); 4504 if (currentDayIsMinDateTimeDay) { 4505 var m = 60 * t.getHours() + t.getMinutes(); 4506 if (m > minTimeMinutesOfDay) minTimeMinutesOfDay = m; 4507 } 4508 } 4509 4510 if (options.maxDateTime !== false) { 4511 var t = _xdsoft_datetime.strToDateTime(options.maxDateTime); 4512 var currentDayIsMaxDateTimeDay = dateHelper.formatDate(_xdsoft_datetime.currentTime, options.formatDate) === dateHelper.formatDate(t, options.formatDate); 4513 if (currentDayIsMaxDateTimeDay) { 4514 var m = 60 * t.getHours() + t.getMinutes(); 4515 if (m < maxTimeMinutesOfDay) maxTimeMinutesOfDay = m; 4516 } 4517 } 4518 4519 line_time = function line_time(h, m) { 4520 var now = _xdsoft_datetime.now(), current_time, 4521 isALlowTimesInit = options.allowTimes && $.isArray(options.allowTimes) && options.allowTimes.length; 4522 now.setHours(h); 4523 h = parseInt(now.getHours(), 10); 4524 now.setMinutes(m); 4525 m = parseInt(now.getMinutes(), 10); 4526 classes = []; 4527 var currentMinutesOfDay = 60 * h + m; 4528 if (input.is('[disabled]') || (currentMinutesOfDay >= maxTimeMinutesOfDay) || (currentMinutesOfDay < minTimeMinutesOfDay)) { 4529 classes.push('xdsoft_disabled'); 4530 } 4531 4532 current_time = new Date(_xdsoft_datetime.currentTime); 4533 current_time.setHours(parseInt(_xdsoft_datetime.currentTime.getHours(), 10)); 4534 4535 if (!isALlowTimesInit) { 4536 current_time.setMinutes(Math[options.roundTime](_xdsoft_datetime.currentTime.getMinutes() / options.step) * options.step); 4537 } 4538 4539 if ((options.initTime || options.defaultSelect || datetimepicker.data('changed')) && current_time.getHours() === parseInt(h, 10) && ((!isALlowTimesInit && options.step > 59) || current_time.getMinutes() === parseInt(m, 10))) { 4540 if (options.defaultSelect || datetimepicker.data('changed')) { 4541 classes.push('xdsoft_current'); 4542 } else if (options.initTime) { 4543 classes.push('xdsoft_init_time'); 4544 } 4545 } 4546 if (parseInt(today.getHours(), 10) === parseInt(h, 10) && parseInt(today.getMinutes(), 10) === parseInt(m, 10)) { 4547 classes.push('xdsoft_today'); 4548 } 4549 time += '<div class="xdsoft_time ' + classes.join(' ') + '" data-hour="' + h + '" data-minute="' + m + '">' + dateHelper.formatDate(now, options.formatTime) + '</div>'; 4550 }; 4551 4552 if (!options.allowTimes || !$.isArray(options.allowTimes) || !options.allowTimes.length) { 4553 for (i = 0, j = 0; i < (options.hours12 ? 12 : 24); i += 1) { 4554 for (j = 0; j < 60; j += options.step) { 4555 var currentMinutesOfDay = i * 60 + j; 4556 if (currentMinutesOfDay < minTimeMinutesOfDay) continue; 4557 if (currentMinutesOfDay >= maxTimeMinutesOfDay) continue; 4558 h = (i < 10 ? '0' : '') + i; 4559 m = (j < 10 ? '0' : '') + j; 4560 line_time(h, m); 4561 } 4562 } 4563 } else { 4564 for (i = 0; i < options.allowTimes.length; i += 1) { 4565 h = _xdsoft_datetime.strtotime(options.allowTimes[i]).getHours(); 4566 m = _xdsoft_datetime.strtotime(options.allowTimes[i]).getMinutes(); 4567 line_time(h, m); 4568 } 4569 } 4570 4571 timebox.html(time); 4572 4573 opt = ''; 4574 4575 for (i = parseInt(options.yearStart, 10); i <= parseInt(options.yearEnd, 10); i += 1) { 4576 opt += '<div class="xdsoft_option ' + (_xdsoft_datetime.currentTime.getFullYear() === i ? 'xdsoft_current' : '') + '" data-value="' + i + '">' + (i + options.yearOffset) + '</div>'; 4577 } 4578 yearselect.children().eq(0) 4579 .html(opt); 4580 4581 for (i = parseInt(options.monthStart, 10), opt = ''; i <= parseInt(options.monthEnd, 10); i += 1) { 4582 opt += '<div class="xdsoft_option ' + (_xdsoft_datetime.currentTime.getMonth() === i ? 'xdsoft_current' : '') + '" data-value="' + i + '">' + options.i18n[globalLocale].months[i] + '</div>'; 4583 } 4584 monthselect.children().eq(0).html(opt); 4585 $(datetimepicker) 4586 .trigger('generate.xdsoft'); 4587 }, 10); 4588 event.stopPropagation(); 4589 }) 4590 .on('afterOpen.xdsoft', function () { 4591 if (options.timepicker) { 4592 var classType, pheight, height, top; 4593 if (timebox.find('.xdsoft_current').length) { 4594 classType = '.xdsoft_current'; 4595 } else if (timebox.find('.xdsoft_init_time').length) { 4596 classType = '.xdsoft_init_time'; 4597 } 4598 if (classType) { 4599 pheight = timeboxparent[0].clientHeight; 4600 height = timebox[0].offsetHeight; 4601 top = timebox.find(classType).index() * options.timeHeightInTimePicker + 1; 4602 if ((height - pheight) < top) { 4603 top = height - pheight; 4604 } 4605 timeboxparent.trigger('scroll_element.xdsoft_scroller', [parseInt(top, 10) / (height - pheight)]); 4606 } else { 4607 timeboxparent.trigger('scroll_element.xdsoft_scroller', [0]); 4608 } 4609 } 4610 }); 4611 4612 timerclick = 0; 4613 calendar 4614 .on('touchend click.xdsoft', 'td', function (xdevent) { 4615 xdevent.stopPropagation(); // Prevents closing of Pop-ups, Modals and Flyouts in Bootstrap 4616 timerclick += 1; 4617 var $this = $(this), 4618 currentTime = _xdsoft_datetime.currentTime; 4619 4620 if (currentTime === undefined || currentTime === null) { 4621 _xdsoft_datetime.currentTime = _xdsoft_datetime.now(); 4622 currentTime = _xdsoft_datetime.currentTime; 4623 } 4624 4625 if ($this.hasClass('xdsoft_disabled')) { 4626 return false; 4627 } 4628 4629 currentTime.setDate(1); 4630 currentTime.setFullYear($this.data('year')); 4631 currentTime.setMonth($this.data('month')); 4632 currentTime.setDate($this.data('date')); 4633 4634 datetimepicker.trigger('select.xdsoft', [currentTime]); 4635 4636 input.val(_xdsoft_datetime.str()); 4637 4638 if (options.onSelectDate && $.isFunction(options.onSelectDate)) { 4639 options.onSelectDate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent); 4640 } 4641 4642 datetimepicker.data('changed', true); 4643 datetimepicker.trigger('xchange.xdsoft'); 4644 datetimepicker.trigger('changedatetime.xdsoft'); 4645 if ((timerclick > 1 || (options.closeOnDateSelect === true || (options.closeOnDateSelect === false && !options.timepicker))) && !options.inline) { 4646 datetimepicker.trigger('close.xdsoft'); 4647 } 4648 setTimeout(function () { 4649 timerclick = 0; 4650 }, 200); 4651 }); 4652 4653 timebox 4654 .on('touchstart', 'div', function (xdevent) { 4655 this.touchMoved = false; 4656 }) 4657 .on('touchmove', 'div', handleTouchMoved) 4658 .on('touchend click.xdsoft', 'div', function (xdevent) { 4659 if (!this.touchMoved) { 4660 xdevent.stopPropagation(); 4661 var $this = $(this), 4662 currentTime = _xdsoft_datetime.currentTime; 4663 4664 if (currentTime === undefined || currentTime === null) { 4665 _xdsoft_datetime.currentTime = _xdsoft_datetime.now(); 4666 currentTime = _xdsoft_datetime.currentTime; 4667 } 4668 4669 if ($this.hasClass('xdsoft_disabled')) { 4670 return false; 4671 } 4672 currentTime.setHours($this.data('hour')); 4673 currentTime.setMinutes($this.data('minute')); 4674 datetimepicker.trigger('select.xdsoft', [currentTime]); 4675 4676 datetimepicker.data('input').val(_xdsoft_datetime.str()); 4677 4678 if (options.onSelectTime && $.isFunction(options.onSelectTime)) { 4679 options.onSelectTime.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent); 4680 } 4681 datetimepicker.data('changed', true); 4682 datetimepicker.trigger('xchange.xdsoft'); 4683 datetimepicker.trigger('changedatetime.xdsoft'); 4684 if (options.inline !== true && options.closeOnTimeSelect === true) { 4685 datetimepicker.trigger('close.xdsoft'); 4686 } 4687 } 4688 }); 4689 4690 datepicker 4691 .on('mousewheel.xdsoft', function (event) { 4692 if (!options.scrollMonth) { 4693 return true; 4694 } 4695 if (event.deltaY < 0) { 4696 _xdsoft_datetime.nextMonth(); 4697 } else { 4698 _xdsoft_datetime.prevMonth(); 4699 } 4700 return false; 4701 }); 4702 4703 input 4704 .on('mousewheel.xdsoft', function (event) { 4705 if (!options.scrollInput) { 4706 return true; 4707 } 4708 if (!options.datepicker && options.timepicker) { 4709 current_time_index = timebox.find('.xdsoft_current').length ? timebox.find('.xdsoft_current').eq(0).index() : 0; 4710 if (current_time_index + event.deltaY >= 0 && current_time_index + event.deltaY < timebox.children().length) { 4711 current_time_index += event.deltaY; 4712 } 4713 if (timebox.children().eq(current_time_index).length) { 4714 timebox.children().eq(current_time_index).trigger('mousedown'); 4715 } 4716 return false; 4717 } 4718 if (options.datepicker && !options.timepicker) { 4719 datepicker.trigger(event, [event.deltaY, event.deltaX, event.deltaY]); 4720 if (input.val) { 4721 input.val(_xdsoft_datetime.str()); 4722 } 4723 datetimepicker.trigger('changedatetime.xdsoft'); 4724 return false; 4725 } 4726 }); 4727 4728 datetimepicker 4729 .on('changedatetime.xdsoft', function (event) { 4730 if (options.onChangeDateTime && $.isFunction(options.onChangeDateTime)) { 4731 var $input = datetimepicker.data('input'); 4732 options.onChangeDateTime.call(datetimepicker, _xdsoft_datetime.currentTime, $input, event); 4733 delete options.value; 4734 $input.trigger('change'); 4735 } 4736 }) 4737 .on('generate.xdsoft', function () { 4738 if (options.onGenerate && $.isFunction(options.onGenerate)) { 4739 options.onGenerate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); 4740 } 4741 if (triggerAfterOpen) { 4742 datetimepicker.trigger('afterOpen.xdsoft'); 4743 triggerAfterOpen = false; 4744 } 4745 }) 4746 .on('click.xdsoft', function (xdevent) { 4747 xdevent.stopPropagation(); 4748 }); 4749 4750 current_time_index = 0; 4751 4752 /** 4753 * Runs the callback for each of the specified node's ancestors. 4754 * 4755 * Return FALSE from the callback to stop ascending. 4756 * 4757 * @param {DOMNode} node 4758 * @param {Function} callback 4759 * @returns {undefined} 4760 */ 4761 forEachAncestorOf = function (node, callback) { 4762 do { 4763 node = node.parentNode; 4764 4765 if (!node || callback(node) === false) { 4766 break; 4767 } 4768 } while (node.nodeName !== 'HTML'); 4769 }; 4770 4771 /** 4772 * Sets the position of the picker. 4773 * 4774 * @returns {undefined} 4775 */ 4776 setPos = function () { 4777 var dateInputOffset, 4778 dateInputElem, 4779 verticalPosition, 4780 left, 4781 position, 4782 datetimepickerElem, 4783 dateInputHasFixedAncestor, 4784 $dateInput, 4785 windowWidth, 4786 verticalAnchorEdge, 4787 datetimepickerCss, 4788 windowHeight, 4789 windowScrollTop; 4790 4791 $dateInput = datetimepicker.data('input'); 4792 dateInputOffset = $dateInput.offset(); 4793 dateInputElem = $dateInput[0]; 4794 4795 verticalAnchorEdge = 'top'; 4796 verticalPosition = (dateInputOffset.top + dateInputElem.offsetHeight) - 1; 4797 left = dateInputOffset.left; 4798 position = "absolute"; 4799 4800 windowWidth = $(options.contentWindow).width(); 4801 windowHeight = $(options.contentWindow).height(); 4802 windowScrollTop = $(options.contentWindow).scrollTop(); 4803 4804 if ((options.ownerDocument.documentElement.clientWidth - dateInputOffset.left) < datepicker.parent().outerWidth(true)) { 4805 var diff = datepicker.parent().outerWidth(true) - dateInputElem.offsetWidth; 4806 left = left - diff; 4807 } 4808 4809 if ($dateInput.parent().css('direction') === 'rtl') { 4810 left -= (datetimepicker.outerWidth() - $dateInput.outerWidth()); 4811 } 4812 4813 if (options.fixed) { 4814 verticalPosition -= windowScrollTop; 4815 left -= $(options.contentWindow).scrollLeft(); 4816 position = "fixed"; 4817 } else { 4818 dateInputHasFixedAncestor = false; 4819
vendor: 3,243 bytes, lines 4820-4910
4820 forEachAncestorOf(dateInputElem, function (ancestorNode) { 4821 if (ancestorNode === null) { 4822 return false; 4823 } 4824 4825 if (options.contentWindow.getComputedStyle(ancestorNode).getPropertyValue('position') === 'fixed') { 4826 dateInputHasFixedAncestor = true; 4827 return false; 4828 } 4829 }); 4830 4831 if (dateInputHasFixedAncestor) { 4832 position = 'fixed'; 4833 4834 //If the picker won't fit entirely within the viewport then display it above the date input. 4835 if (verticalPosition + datetimepicker.outerHeight() > windowHeight + windowScrollTop) { 4836 verticalAnchorEdge = 'bottom'; 4837 verticalPosition = (windowHeight + windowScrollTop) - dateInputOffset.top; 4838 } else { 4839 verticalPosition -= windowScrollTop; 4840 } 4841 } else { 4842 if (verticalPosition + datetimepicker[0].offsetHeight > windowHeight + windowScrollTop) { 4843 verticalPosition = dateInputOffset.top - datetimepicker[0].offsetHeight + 1; 4844 } 4845 } 4846 4847 if (verticalPosition < 0) { 4848 verticalPosition = 0; 4849 } 4850 4851 if (left + dateInputElem.offsetWidth > windowWidth) { 4852 left = windowWidth - dateInputElem.offsetWidth; 4853 } 4854 } 4855 4856 datetimepickerElem = datetimepicker[0]; 4857 4858 forEachAncestorOf(datetimepickerElem, function (ancestorNode) { 4859 var ancestorNodePosition; 4860 4861 ancestorNodePosition = options.contentWindow.getComputedStyle(ancestorNode).getPropertyValue('position'); 4862 4863 if (ancestorNodePosition === 'relative' && windowWidth >= ancestorNode.offsetWidth) { 4864 left = left - ((windowWidth - ancestorNode.offsetWidth) / 2); 4865 return false; 4866 } 4867 }); 4868 4869 datetimepickerCss = { 4870 position: position, 4871 left: left, 4872 top: '', //Initialize to prevent previous values interfering with new ones. 4873 bottom: '' //Initialize to prevent previous values interfering with new ones. 4874 }; 4875 4876 datetimepickerCss[verticalAnchorEdge] = verticalPosition; 4877 4878 datetimepicker.css(datetimepickerCss); 4879 }; 4880 4881 datetimepicker 4882 .on('open.xdsoft', function (event) { 4883 var onShow = true; 4884 if (options.onShow && $.isFunction(options.onShow)) { 4885 onShow = options.onShow.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event); 4886 } 4887 if (onShow !== false) { 4888 datetimepicker.show(); 4889 setPos(); 4890 $(options.contentWindow) 4891 .off('resize.xdsoft', setPos) 4892 .on('resize.xdsoft', setPos); 4893 4894 if (options.closeOnWithoutClick) { 4895 $([options.ownerDocument.body, options.contentWindow]).on('touchstart mousedown.xdsoft', function arguments_callee6() { 4896 datetimepicker.trigger('close.xdsoft'); 4897 $([options.ownerDocument.body, options.contentWindow]).off('touchstart mousedown.xdsoft', arguments_callee6); 4898 }); 4899 } 4900 } 4901 }) 4902 .on('close.xdsoft', function (event) { 4903 var onClose = true; 4904 month_picker 4905 .find('.xdsoft_month,.xdsoft_year') 4906 .find('.xdsoft_select') 4907 .hide(); 4908 if (options.onClose && $.isFunction(options.onClose)) { 4909 onClose = options.onClose.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event); 4910 }
vendor: 13,224 bytes, lines 4911-5312
4911 if (onClose !== false && !options.opened && !options.inline) { 4912 datetimepicker.hide(); 4913 } 4914 event.stopPropagation(); 4915 }) 4916 .on('toggle.xdsoft', function () { 4917 if (datetimepicker.is(':visible')) { 4918 datetimepicker.trigger('close.xdsoft'); 4919 } else { 4920 datetimepicker.trigger('open.xdsoft'); 4921 } 4922 }) 4923 .data('input', input); 4924 4925 timer = 0; 4926 4927 datetimepicker.data('xdsoft_datetime', _xdsoft_datetime); 4928 datetimepicker.setOptions(options); 4929 4930 function getCurrentValue() { 4931 var ct = false, time; 4932 4933 if (options.startDate) { 4934 ct = _xdsoft_datetime.strToDate(options.startDate); 4935 } else { 4936 ct = options.value || ((input && input.val && input.val()) ? input.val() : ''); 4937 if (ct) { 4938 ct = _xdsoft_datetime.strToDateTime(ct); 4939 if (options.yearOffset) { 4940 ct = new Date(ct.getFullYear() - options.yearOffset, ct.getMonth(), ct.getDate(), ct.getHours(), ct.getMinutes(), ct.getSeconds(), ct.getMilliseconds()); 4941 } 4942 } else if (options.defaultDate) { 4943 ct = _xdsoft_datetime.strToDateTime(options.defaultDate); 4944 if (options.defaultTime) { 4945 time = _xdsoft_datetime.strtotime(options.defaultTime); 4946 ct.setHours(time.getHours()); 4947 ct.setMinutes(time.getMinutes()); 4948 } 4949 } 4950 } 4951 4952 if (ct && _xdsoft_datetime.isValidDate(ct)) { 4953 datetimepicker.data('changed', true); 4954 } else { 4955 ct = ''; 4956 } 4957 4958 return ct || 0; 4959 } 4960 4961 function setMask(options) { 4962 4963 var isValidValue = function (mask, value) { 4964 var reg = mask 4965 .replace(/([\[\]\/\{\}\(\)\-\.\+]{1})/g, '\\$1') 4966 .replace(/_/g, '{digit+}') 4967 .replace(/([0-9]{1})/g, '{digit$1}') 4968 .replace(/\{digit([0-9]{1})\}/g, '[0-$1_]{1}') 4969 .replace(/\{digit[\+]\}/g, '[0-9_]{1}'); 4970 return (new RegExp(reg)).test(value); 4971 }, 4972 getCaretPos = function (input) { 4973 try { 4974 if (options.ownerDocument.selection && options.ownerDocument.selection.createRange) { 4975 var range = options.ownerDocument.selection.createRange(); 4976 return range.getBookmark().charCodeAt(2) - 2; 4977 } 4978 if (input.setSelectionRange) { 4979 return input.selectionStart; 4980 } 4981 } catch (e) { 4982 return 0; 4983 } 4984 }, 4985 setCaretPos = function (node, pos) { 4986 node = (typeof node === "string" || node instanceof String) ? options.ownerDocument.getElementById(node) : node; 4987 if (!node) { 4988 return false; 4989 } 4990 if (node.createTextRange) { 4991 var textRange = node.createTextRange(); 4992 textRange.collapse(true); 4993 textRange.moveEnd('character', pos); 4994 textRange.moveStart('character', pos); 4995 textRange.select(); 4996 return true; 4997 } 4998 if (node.setSelectionRange) { 4999 node.setSelectionRange(pos, pos); 5000 return true; 5001 } 5002 return false; 5003 }; 5004 5005 if(options.mask) { 5006 input.off('keydown.xdsoft'); 5007 } 5008 5009 if (options.mask === true) { 5010 if (dateHelper.formatMask) { 5011 options.mask = dateHelper.formatMask(options.format) 5012 } else { 5013 options.mask = options.format 5014 .replace(/Y/g, '9999') 5015 .replace(/F/g, '9999') 5016 .replace(/m/g, '19') 5017 .replace(/d/g, '39') 5018 .replace(/H/g, '29') 5019 .replace(/i/g, '59') 5020 .replace(/s/g, '59'); 5021 } 5022 } 5023 5024 if ($.type(options.mask) === 'string') { 5025 if (!isValidValue(options.mask, input.val())) { 5026 input.val(options.mask.replace(/[0-9]/g, '_')); 5027 setCaretPos(input[0], 0); 5028 } 5029 5030 input.off('paste.xdsoft').on('paste.xdsoft', function (event) { 5031 // couple options here 5032 // 1. return false - tell them they can't paste 5033 // 2. insert over current characters - minimal validation 5034 // 3. full fledged parsing and validation 5035 // let's go option 2 for now 5036 5037 // fires multiple times for some reason 5038 5039 // https://stackoverflow.com/a/30496488/1366033 5040 var clipboardData = event.clipboardData || event.originalEvent.clipboardData || window.clipboardData, 5041 pastedData = clipboardData.getData('text'), 5042 val = this.value, 5043 pos = this.selectionStart 5044 5045 var valueBeforeCursor = val.substr(0, pos); 5046 var valueAfterPaste = val.substr(pos + pastedData.length); 5047 5048 val = valueBeforeCursor + pastedData + valueAfterPaste; 5049 val = val.substring(0, options.mask.length) 5050 pos += pastedData.length; 5051 5052 if (isValidValue(options.mask, val)) { 5053 this.value = val; 5054 setCaretPos(this, pos); 5055 } else if ($.trim(val) === '') { 5056 this.value = options.mask.replace(/[0-9]/g, '_'); 5057 } else { 5058 input.trigger('error_input.xdsoft'); 5059 } 5060 5061 event.preventDefault(); 5062 return false; 5063 }); 5064 5065 input.on('keydown.xdsoft', function (event) { 5066 var val = this.value, 5067 key = event.which, 5068 pos = this.selectionStart, 5069 selEnd = this.selectionEnd, 5070 hasSel = pos !== selEnd, 5071 digit; 5072 5073 // only alow these characters 5074 if (((key >= KEY0 && key <= KEY9) || 5075 (key >= _KEY0 && key <= _KEY9)) || 5076 (key === BACKSPACE || key === DEL)) { 5077 5078 // get char to insert which is new character or placeholder ('_') 5079 digit = (key === BACKSPACE || key === DEL) ? '_' : 5080 String.fromCharCode((_KEY0 <= key && key <= _KEY9) ? key - KEY0 : key); 5081 5082 // we're deleting something, we're not at the start, and have normal cursor, move back one 5083 // if we have a selection length, cursor actually sits behind deletable char, not in front 5084 if (key === BACKSPACE && pos && !hasSel) { 5085 pos -= 1; 5086 } 5087 5088 // don't stop on a separator, continue whatever direction you were going 5089 // value char - keep incrementing position while on separator char and we still have room 5090 // del char - keep decrementing position while on separator char and we still have room 5091 while (true) { 5092 var maskValueAtCurPos = options.mask.substr(pos, 1); 5093 var posShorterThanMaskLength = pos < options.mask.length; 5094 var posGreaterThanZero = pos > 0; 5095 var notNumberOrPlaceholder = /[^0-9_]/; 5096 var curPosOnSep = notNumberOrPlaceholder.test(maskValueAtCurPos); 5097 var continueMovingPosition = curPosOnSep && posShorterThanMaskLength && posGreaterThanZero 5098 5099 // if we hit a real char, stay where we are 5100 if (!continueMovingPosition) break; 5101 5102 // hitting backspace in a selection, you can possibly go back any further - go forward 5103 pos += (key === BACKSPACE && !hasSel) ? -1 : 1; 5104 5105 } 5106 5107 5108 if (hasSel) { 5109 // pos might have moved so re-calc length 5110 var selLength = selEnd - pos 5111 5112 // if we have a selection length we will wipe out entire selection and replace with default template for that range 5113 var defaultBlank = options.mask.replace(/[0-9]/g, '_'); 5114 var defaultBlankSelectionReplacement = defaultBlank.substr(pos, selLength); 5115 var selReplacementRemainder = defaultBlankSelectionReplacement.substr(1) // might be empty 5116 5117 var valueBeforeSel = val.substr(0, pos); 5118 var insertChars = digit + selReplacementRemainder; 5119 var charsAfterSelection = val.substr(pos + selLength); 5120 5121 val = valueBeforeSel + insertChars + charsAfterSelection 5122 5123 } else { 5124 var valueBeforeCursor = val.substr(0, pos); 5125 var insertChar = digit; 5126 var valueAfterNextChar = val.substr(pos + 1); 5127 5128 val = valueBeforeCursor + insertChar + valueAfterNextChar 5129 } 5130 5131 if ($.trim(val) === '') { 5132 // if empty, set to default 5133 val = defaultBlank 5134 } else { 5135 // if at the last character don't need to do anything 5136 if (pos === options.mask.length) { 5137 event.preventDefault(); 5138 return false; 5139 } 5140 } 5141 5142 // resume cursor location 5143 pos += (key === BACKSPACE) ? 0 : 1; 5144 // don't stop on a separator, continue whatever direction you were going 5145 while (/[^0-9_]/.test(options.mask.substr(pos, 1)) && pos < options.mask.length && pos > 0) { 5146 pos += (key === BACKSPACE) ? 0 : 1; 5147 } 5148 5149 if (isValidValue(options.mask, val)) { 5150 this.value = val; 5151 setCaretPos(this, pos); 5152 } else if ($.trim(val) === '') { 5153 this.value = options.mask.replace(/[0-9]/g, '_'); 5154 } else { 5155 input.trigger('error_input.xdsoft'); 5156 } 5157 } else { 5158 if (([AKEY, CKEY, VKEY, ZKEY, YKEY].indexOf(key) !== -1 && ctrlDown) || [ESC, ARROWUP, ARROWDOWN, ARROWLEFT, ARROWRIGHT, F5, CTRLKEY, TAB, ENTER].indexOf(key) !== -1) { 5159 return true; 5160 } 5161 } 5162 5163 event.preventDefault(); 5164 return false; 5165 }); 5166 } 5167 } 5168 5169 _xdsoft_datetime.setCurrentTime(getCurrentValue()); 5170 5171 input 5172 .data('xdsoft_datetimepicker', datetimepicker) 5173 .on('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', function () { 5174 if (input.is(':disabled') || (input.data('xdsoft_datetimepicker').is(':visible') && options.closeOnInputClick)) { 5175 return; 5176 } 5177 if (!options.openOnFocus) { 5178 return; 5179 } 5180 clearTimeout(timer); 5181 timer = setTimeout(function () { 5182 if (input.is(':disabled')) { 5183 return; 5184 } 5185 5186 triggerAfterOpen = true; 5187 _xdsoft_datetime.setCurrentTime(getCurrentValue(), true); 5188 if(options.mask) { 5189 setMask(options); 5190 } 5191 datetimepicker.trigger('open.xdsoft'); 5192 }, 100); 5193 }) 5194 .on('keydown.xdsoft', function (event) { 5195 var elementSelector, 5196 key = event.which; 5197 if ([ENTER].indexOf(key) !== -1 && options.enterLikeTab) { 5198 elementSelector = $("input:visible,textarea:visible,button:visible,a:visible"); 5199 datetimepicker.trigger('close.xdsoft'); 5200 elementSelector.eq(elementSelector.index(this) + 1).focus(); 5201 return false; 5202 } 5203 if ([TAB].indexOf(key) !== -1) { 5204 datetimepicker.trigger('close.xdsoft'); 5205 return true; 5206 } 5207 }) 5208 .on('blur.xdsoft', function () { 5209 datetimepicker.trigger('close.xdsoft'); 5210 }); 5211 }; 5212 destroyDateTimePicker = function (input) { 5213 var datetimepicker = input.data('xdsoft_datetimepicker'); 5214 if (datetimepicker) { 5215 datetimepicker.data('xdsoft_datetime', null); 5216 datetimepicker.remove(); 5217 input 5218 .data('xdsoft_datetimepicker', null) 5219 .off('.xdsoft'); 5220 $(options.contentWindow).off('resize.xdsoft'); 5221 $([options.contentWindow, options.ownerDocument.body]).off('mousedown.xdsoft touchstart'); 5222 if (input.unmousewheel) { 5223 input.unmousewheel(); 5224 } 5225 } 5226 }; 5227 $(options.ownerDocument) 5228 .off('keydown.xdsoftctrl keyup.xdsoftctrl') 5229 .on('keydown.xdsoftctrl', function (e) { 5230 if (e.keyCode === CTRLKEY) { 5231 ctrlDown = true; 5232 } 5233 }) 5234 .on('keyup.xdsoftctrl', function (e) { 5235 if (e.keyCode === CTRLKEY) { 5236 ctrlDown = false; 5237 } 5238 }); 5239 5240 this.each(function () { 5241 var datetimepicker = $(this).data('xdsoft_datetimepicker'), $input; 5242 if (datetimepicker) { 5243 if ($.type(opt) === 'string') { 5244 switch (opt) { 5245 case 'show': 5246 $(this).select().focus(); 5247 datetimepicker.trigger('open.xdsoft'); 5248 break; 5249 case 'hide': 5250 datetimepicker.trigger('close.xdsoft'); 5251 break; 5252 case 'toggle': 5253 datetimepicker.trigger('toggle.xdsoft'); 5254 break; 5255 case 'destroy': 5256 destroyDateTimePicker($(this)); 5257 break; 5258 case 'reset': 5259 this.value = this.defaultValue; 5260 if (!this.value || !datetimepicker.data('xdsoft_datetime').isValidDate(dateHelper.parseDate(this.value, options.format))) { 5261 datetimepicker.data('changed', false); 5262 } 5263 datetimepicker.data('xdsoft_datetime').setCurrentTime(this.value); 5264 break; 5265 case 'validate': 5266 $input = datetimepicker.data('input'); 5267 $input.trigger('blur.xdsoft'); 5268 break; 5269 default: 5270 if (datetimepicker[opt] && $.isFunction(datetimepicker[opt])) { 5271 result = datetimepicker[opt](opt2); 5272 } 5273 } 5274 } else { 5275 datetimepicker 5276 .setOptions(opt); 5277 } 5278 return 0; 5279 } 5280 if ($.type(opt) !== 'string') { 5281 if (!options.lazyInit || options.open || options.inline) { 5282 createDateTimePicker($(this)); 5283 } else { 5284 lazyInit($(this)); 5285 } 5286 } 5287 }); 5288 5289 return result; 5290 }; 5291 5292 $.fn.datetimepicker.defaults = default_options; 5293 5294 function HighlightedDate(date, desc, style) { 5295 "use strict"; 5296 this.date = date; 5297 this.desc = desc; 5298 this.style = style; 5299 } 5300}; 5301;(function (factory) { 5302 if ( typeof define === 'function' && define.amd ) { 5303 // AMD. Register as an anonymous module. 5304 define(['jquery', 'jquery-mousewheel'], factory); 5305 } else if (typeof exports === 'object') { 5306 // Node/CommonJS style for Browserify 5307 module.exports = factory(require('jquery'));; 5308 } else { 5309 // Browser globals 5310 factory(jQuery); 5311 } 5312}
5312(datetimepickerFactory));
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.