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