All Downloads are FREE. Search and download functionalities are using the official Maven repository.

bootstrap.datetimepicker.bootstrap-datetimepicker.min.js Maven / Gradle / Ivy

There is a newer version: 2.0.2
Show newest version
!function(f){function s(){return new Date(Date.UTC.apply(Date,arguments))}var u=function(a,b){var c=this;this.element=f(a);this.container=b.container||"body";this.language=b.language||this.element.data("date-language")||"en";this.language=this.language in g?this.language:"en";this.isRTL=g[this.language].rtl||!1;this.formatType=b.formatType||this.element.data("format-type")||"standard";this.format=e.parseFormat(b.format||this.element.data("date-format")||g[this.language].format||e.getDefaultFormat(this.formatType,
"input"),this.formatType);this.isVisible=this.isInline=!1;this.isInput=this.element.is("input");this.fontAwesome=b.fontAwesome||this.element.data("font-awesome")||!1;this.bootcssVer=b.bootcssVer||(this.isInput?this.element.is(".form-control")?3:2:this.bootcssVer=this.element.is(".input-group")?3:2);this.component=this.element.is(".date")?3==this.bootcssVer?this.element.find(".input-group-addon .glyphicon-th, .input-group-addon .glyphicon-time, .input-group-addon .glyphicon-calendar, .input-group-addon .glyphicon-calendar .fa-calendar .fa-clock-o").parent():
this.element.find(".add-on .icon-th, .add-on .icon-time, .add-on .icon-calendar .fa-calendar .fa-clock-o").parent():!1;this.componentReset=this.element.is(".date")?3==this.bootcssVer?this.element.find(".input-group-addon .glyphicon-remove .fa-times").parent():this.element.find(".add-on .icon-remove .fa-times").parent():!1;this.hasInput=this.component&&this.element.find("input").length;this.component&&0===this.component.length&&(this.component=!1);this.linkField=b.linkField||this.element.data("link-field")||
!1;this.linkFormat=e.parseFormat(b.linkFormat||this.element.data("link-format")||e.getDefaultFormat(this.formatType,"link"),this.formatType);this.minuteStep=b.minuteStep||this.element.data("minute-step")||5;this.pickerPosition=b.pickerPosition||this.element.data("picker-position")||"bottom-right";this.showMeridian=b.showMeridian||this.element.data("show-meridian")||!1;this.initialDate=b.initialDate||new Date;this.icons={leftArrow:this.fontAwesome?"fa-arrow-left":3===this.bootcssVer?"glyphicon-arrow-left":
"icon-arrow-left",rightArrow:this.fontAwesome?"fa-arrow-right":3===this.bootcssVer?"glyphicon-arrow-right":"icon-arrow-right"};this.icontype=this.fontAwesome?"fa":"glyphicon";this._attachEvents();this.formatViewType="datetime";"formatViewType"in b?this.formatViewType=b.formatViewType:"formatViewType"in this.element.data()&&(this.formatViewType=this.element.data("formatViewType"));this.minView=0;"minView"in b?this.minView=b.minView:"minView"in this.element.data()&&(this.minView=this.element.data("min-view"));
this.minView=e.convertViewMode(this.minView);this.maxView=e.modes.length-1;"maxView"in b?this.maxView=b.maxView:"maxView"in this.element.data()&&(this.maxView=this.element.data("max-view"));this.maxView=e.convertViewMode(this.maxView);this.wheelViewModeNavigation=!1;"wheelViewModeNavigation"in b?this.wheelViewModeNavigation=b.wheelViewModeNavigation:"wheelViewModeNavigation"in this.element.data()&&(this.wheelViewModeNavigation=this.element.data("view-mode-wheel-navigation"));this.wheelViewModeNavigationInverseDirection=
!1;"wheelViewModeNavigationInverseDirection"in b?this.wheelViewModeNavigationInverseDirection=b.wheelViewModeNavigationInverseDirection:"wheelViewModeNavigationInverseDirection"in this.element.data()&&(this.wheelViewModeNavigationInverseDirection=this.element.data("view-mode-wheel-navigation-inverse-dir"));this.wheelViewModeNavigationDelay=100;"wheelViewModeNavigationDelay"in b?this.wheelViewModeNavigationDelay=b.wheelViewModeNavigationDelay:"wheelViewModeNavigationDelay"in this.element.data()&&(this.wheelViewModeNavigationDelay=
this.element.data("view-mode-wheel-navigation-delay"));this.startViewMode=2;"startView"in b?this.startViewMode=b.startView:"startView"in this.element.data()&&(this.startViewMode=this.element.data("start-view"));this.viewMode=this.startViewMode=e.convertViewMode(this.startViewMode);this.viewSelect=this.minView;"viewSelect"in b?this.viewSelect=b.viewSelect:"viewSelect"in this.element.data()&&(this.viewSelect=this.element.data("view-select"));this.viewSelect=e.convertViewMode(this.viewSelect);this.forceParse=
!0;"forceParse"in b?this.forceParse=b.forceParse:"dateForceParse"in this.element.data()&&(this.forceParse=this.element.data("date-force-parse"));for(var d=3===this.bootcssVer?e.templateV3:e.template;-1!==d.indexOf("{iconType}");)d=d.replace("{iconType}",this.icontype);for(;-1!==d.indexOf("{leftArrow}");)d=d.replace("{leftArrow}",this.icons.leftArrow);for(;-1!==d.indexOf("{rightArrow}");)d=d.replace("{rightArrow}",this.icons.rightArrow);this.picker=f(d).appendTo(this.isInline?this.element:this.container).on({click:f.proxy(this.click,
this),mousedown:f.proxy(this.mousedown,this)});if(this.wheelViewModeNavigation)if(f.fn.mousewheel)this.picker.on({mousewheel:f.proxy(this.mousewheel,this)});else console.log("Mouse Wheel event is not supported. Please include the jQuery Mouse Wheel plugin before enabling this option");this.isInline?this.picker.addClass("datetimepicker-inline"):this.picker.addClass("datetimepicker-dropdown-"+this.pickerPosition+" dropdown-menu");this.isRTL&&(this.picker.addClass("datetimepicker-rtl"),this.picker.find(3===
this.bootcssVer?".prev span, .next span":".prev i, .next i").toggleClass(this.icons.leftArrow+" "+this.icons.rightArrow));f(document).on("mousedown",function(a){0===f(a.target).closest(".datetimepicker").length&&c.hide()});this.autoclose=!1;"autoclose"in b?this.autoclose=b.autoclose:"dateAutoclose"in this.element.data()&&(this.autoclose=this.element.data("date-autoclose"));this.keyboardNavigation=!0;"keyboardNavigation"in b?this.keyboardNavigation=b.keyboardNavigation:"dateKeyboardNavigation"in this.element.data()&&
(this.keyboardNavigation=this.element.data("date-keyboard-navigation"));this.todayBtn=b.todayBtn||this.element.data("date-today-btn")||!1;this.todayHighlight=b.todayHighlight||this.element.data("date-today-highlight")||!1;this.weekStart=(b.weekStart||this.element.data("date-weekstart")||g[this.language].weekStart||0)%7;this.weekEnd=(this.weekStart+6)%7;this.startDate=-Infinity;this.endDate=Infinity;this.daysOfWeekDisabled=[];this.setStartDate(b.startDate||this.element.data("date-startdate"));this.setEndDate(b.endDate||
this.element.data("date-enddate"));this.setDaysOfWeekDisabled(b.daysOfWeekDisabled||this.element.data("date-days-of-week-disabled"));this.setMinutesDisabled(b.minutesDisabled||this.element.data("date-minute-disabled"));this.setHoursDisabled(b.hoursDisabled||this.element.data("date-hour-disabled"));this.fillDow();this.fillMonths();this.update();this.showMode();this.isInline&&this.show()};u.prototype={constructor:u,_events:[],_attachEvents:function(){this._detachEvents();this.isInput?this._events=[[this.element,
{focus:f.proxy(this.show,this),keyup:f.proxy(this.update,this),keydown:f.proxy(this.keydown,this)}]]:this.component&&this.hasInput?(this._events=[[this.element.find("input"),{focus:f.proxy(this.show,this),keyup:f.proxy(this.update,this),keydown:f.proxy(this.keydown,this)}],[this.component,{click:f.proxy(this.show,this)}]],this.componentReset&&this._events.push([this.componentReset,{click:f.proxy(this.reset,this)}])):this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:f.proxy(this.show,
this)}]];for(var a=0,b,c;a=this.startDate&&a<=this.endDate?(this.date=a,this.setValue(),this.viewDate=this.date,this.fill()):this.element.trigger({type:"outOfRange",date:a,startDate:this.startDate,endDate:this.endDate})},
setFormat:function(a){this.format=e.parseFormat(a,this.formatType);var b;this.isInput?b=this.element:this.component&&(b=this.element.find("input"));b&&b.val()&&this.setValue()},setValue:function(){var a=this.getFormattedDate();this.isInput?this.element.val(a):(this.component&&this.element.find("input").val(a),this.element.data("date",a));this.linkField&&f("#"+this.linkField).val(this.getFormattedDate(this.linkFormat))},getFormattedDate:function(a){void 0==a&&(a=this.format);return e.formatDate(this.date,
a,this.language,this.formatType)},setStartDate:function(a){this.startDate=a||-Infinity;-Infinity!==this.startDate&&(this.startDate=e.parseDate(this.startDate,this.format,this.language,this.formatType));this.update();this.updateNavArrows()},setEndDate:function(a){this.endDate=a||Infinity;Infinity!==this.endDate&&(this.endDate=e.parseDate(this.endDate,this.format,this.language,this.formatType));this.update();this.updateNavArrows()},setDaysOfWeekDisabled:function(a){this.daysOfWeekDisabled=a||[];f.isArray(this.daysOfWeekDisabled)||
(this.daysOfWeekDisabled=this.daysOfWeekDisabled.split(/,\s*/));this.daysOfWeekDisabled=f.map(this.daysOfWeekDisabled,function(a){return parseInt(a,10)});this.update();this.updateNavArrows()},setMinutesDisabled:function(a){this.minutesDisabled=a||[];f.isArray(this.minutesDisabled)||(this.minutesDisabled=this.minutesDisabled.split(/,\s*/));this.minutesDisabled=f.map(this.minutesDisabled,function(a){return parseInt(a,10)});this.update();this.updateNavArrows()},setHoursDisabled:function(a){this.hoursDisabled=
a||[];f.isArray(this.hoursDisabled)||(this.hoursDisabled=this.hoursDisabled.split(/,\s*/));this.hoursDisabled=f.map(this.hoursDisabled,function(a){return parseInt(a,10)});this.update();this.updateNavArrows()},place:function(){if(!this.isInline){var a=0;f("div").each(function(){var b=parseInt(f(this).css("zIndex"),10);b>a&&(a=b)});var b=a+10,c,d,k;k=this.container instanceof f?this.container.offset():f(this.container).offset();if(this.component){if(c=this.component.offset(),d=c.left,"bottom-left"==
this.pickerPosition||"top-left"==this.pickerPosition)d+=this.component.outerWidth()-this.picker.outerWidth()}else c=this.element.offset(),d=c.left;d+220>document.body.clientWidth&&(d=document.body.clientWidth-220);c="top-left"==this.pickerPosition||"top-right"==this.pickerPosition?c.top-this.picker.outerHeight():c.top+this.height;c-=k.top;d-=k.left;this.picker.css({top:c,left:d,zIndex:b})}},update:function(){var a,b=!1;if(arguments&&arguments.length&&("string"===typeof arguments[0]||arguments[0]instanceof
Date))a=arguments[0],b=!0;else if(a=(this.isInput?this.element.val():this.element.find("input").val())||this.element.data("date")||this.initialDate,"string"==typeof a||a instanceof String)a=a.replace(/^\s+|\s+$/g,"");a||(a=new Date,b=!1);this.date=e.parseDate(a,this.format,this.language,this.formatType);b&&this.setValue();this.viewDate=this.datethis.endDate?new Date(this.endDate):new Date(this.date);this.fill()},fillDow:function(){for(var a=this.weekStart,
b="";a'+g[this.language].daysMin[a++%7]+"";b+="";this.picker.find(".datetimepicker-days thead").append(b)},fillMonths:function(){for(var a="",b=0;12>b;)a+=''+g[this.language].monthsShort[b++]+"";this.picker.find(".datetimepicker-months td").html(a)},fill:function(){if(null!=this.date&&null!=this.viewDate){var a=new Date(this.viewDate),b=a.getUTCFullYear(),c=a.getUTCMonth(),d=a.getUTCDate(),k=a.getUTCHours(),l=a.getUTCMinutes(),
a=-Infinity!==this.startDate?this.startDate.getUTCFullYear():-Infinity,v=-Infinity!==this.startDate?this.startDate.getUTCMonth()+1:-Infinity,w=Infinity!==this.endDate?this.endDate.getUTCFullYear():Infinity,t=Infinity!==this.endDate?this.endDate.getUTCMonth()+1:Infinity,h=(new s(this.date.getUTCFullYear(),this.date.getUTCMonth(),this.date.getUTCDate())).valueOf(),r=new Date;this.picker.find(".datetimepicker-days thead th:eq(1)").text(g[this.language].months[c]+" "+b);if("time"==this.formatViewType){var n=
this.getFormattedDate();this.picker.find(".datetimepicker-hours thead th:eq(1)").text(n);this.picker.find(".datetimepicker-minutes thead th:eq(1)").text(n)}else this.picker.find(".datetimepicker-hours thead th:eq(1)").text(d+" "+g[this.language].months[c]+" "+b),this.picker.find(".datetimepicker-minutes thead th:eq(1)").text(d+" "+g[this.language].months[c]+" "+b);this.picker.find("tfoot th.today").text(g[this.language].today).toggle(!1!==this.todayBtn);this.updateNavArrows();this.fillMonths();var m=
s(b,c-1,28,0,0,0,0),n=e.getDaysInMonth(m.getUTCFullYear(),m.getUTCMonth());m.setUTCDate(n);m.setUTCDate(n-(m.getUTCDay()-this.weekStart+7)%7);var p=new Date(m);p.setUTCDate(p.getUTCDate()+42);for(var p=p.valueOf(),n=[],q;m.valueOf()");q="";if(m.getUTCFullYear()b||m.getUTCFullYear()==b&&m.getUTCMonth()>c)q+=" new";this.todayHighlight&&m.getUTCFullYear()==r.getFullYear()&&
m.getUTCMonth()==r.getMonth()&&m.getUTCDate()==r.getDate()&&(q+=" today");m.valueOf()==h&&(q+=" active");if(m.valueOf()+864E5<=this.startDate||m.valueOf()>this.endDate||-1!==f.inArray(m.getUTCDay(),this.daysOfWeekDisabled))q+=" disabled";n.push(''+m.getUTCDate()+"");m.getUTCDay()==this.weekEnd&&n.push("");m.setUTCDate(m.getUTCDate()+1)}this.picker.find(".datetimepicker-days tbody").empty().append(n.join(""));n=[];r=p=p="";m=this.hoursDisabled||[];for(h=0;24>h;h++)-1===
f.inArray(h,m)&&(p=s(b,c,d,h),q="",p.valueOf()+36E5<=this.startDate||p.valueOf()>this.endDate?q+=" disabled":k==h&&(q+=" active"),this.showMeridian&&2==g[this.language].meridiem.length?(p=12>h?g[this.language].meridiem[0]:g[this.language].meridiem[1],p!=r&&(""!=r&&n.push(""),n.push('
'+p.toUpperCase()+"")),r=p,p=h%12?h%12:12,n.push('h?"am":"pm")+'">'+p+""),23==h&&n.push("
")):(p=h+":00",n.push(''+p+"")));this.picker.find(".datetimepicker-hours td").html(n.join(""));n=[];r="";m=this.minutesDisabled||[];for(h=0;60>h;h+=this.minuteStep)-1===f.inArray(h,m)&&(p=s(b,c,d,k,h,0),q="",p.valueOf()this.endDate?q+=" disabled":Math.floor(l/this.minuteStep)==Math.floor(h/this.minuteStep)&&(q+=" active"),this.showMeridian&&2==g[this.language].meridiem.length?(p=12>k?g[this.language].meridiem[0]:g[this.language].meridiem[1],p!=r&&(""!=r&&n.push(""),n.push('
'+ p.toUpperCase()+"")),r=p,p=k%12?k%12:12,n.push(''+p+":"+(10>h?"0"+h:h)+""),59==h&&n.push("
")):n.push(''+k+":"+(10>h?"0"+h:h)+""));this.picker.find(".datetimepicker-minutes td").html(n.join(""));c=this.date.getUTCFullYear();d=this.picker.find(".datetimepicker-months").find("th:eq(1)").text(b).end().find("span").removeClass("active");c==b&&d.eq(this.date.getUTCMonth()+2).addClass("active");(bw)&&d.addClass("disabled"); b==a&&d.slice(0,v+1).addClass("disabled");b==w&&d.slice(t).addClass("disabled");n="";b=10*parseInt(b/10,10);v=this.picker.find(".datetimepicker-years").find("th:eq(1)").text(b+"-"+(b+9)).end().find("td");b-=1;for(h=-1;11>h;h++)n+='w?" disabled":"")+'">'+b+"",b+=1;v.html(n);this.place()}},updateNavArrows:function(){var a=new Date(this.viewDate),b=a.getUTCFullYear(),c=a.getUTCMonth(),d=a.getUTCDate(),a=a.getUTCHours();switch(this.viewMode){case 0:-Infinity!== this.startDate&&b<=this.startDate.getUTCFullYear()&&c<=this.startDate.getUTCMonth()&&d<=this.startDate.getUTCDate()&&a<=this.startDate.getUTCHours()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"});Infinity!==this.endDate&&b>=this.endDate.getUTCFullYear()&&c>=this.endDate.getUTCMonth()&&d>=this.endDate.getUTCDate()&&a>=this.endDate.getUTCHours()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"}); break;case 1:-Infinity!==this.startDate&&b<=this.startDate.getUTCFullYear()&&c<=this.startDate.getUTCMonth()&&d<=this.startDate.getUTCDate()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"});Infinity!==this.endDate&&b>=this.endDate.getUTCFullYear()&&c>=this.endDate.getUTCMonth()&&d>=this.endDate.getUTCDate()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 2:-Infinity!==this.startDate&& b<=this.startDate.getUTCFullYear()&&c<=this.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"});Infinity!==this.endDate&&b>=this.endDate.getUTCFullYear()&&c>=this.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 3:case 4:-Infinity!==this.startDate&&b<=this.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}): this.picker.find(".prev").css({visibility:"visible"}),Infinity!==this.endDate&&b>=this.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}},mousewheel:function(a){a.preventDefault();a.stopPropagation();this.wheelPause||(this.wheelPause=!0,a=a.originalEvent.wheelDelta,a=0this.endDate&&(a=this.endDate),this.viewMode=this.startViewMode,this.showMode(0),this._setDate(a),this.fill(),this.autoclose&&this.hide()}break;case "span":if(!a.is(".disabled")){var b=this.viewDate.getUTCFullYear(),c=this.viewDate.getUTCMonth(),d=this.viewDate.getUTCDate(),k=this.viewDate.getUTCHours(),l=this.viewDate.getUTCMinutes(),g=this.viewDate.getUTCSeconds();if(a.is(".month"))this.viewDate.setUTCDate(1), c=a.parent().find("span").index(a),d=this.viewDate.getUTCDate(),this.viewDate.setUTCMonth(c),this.element.trigger({type:"changeMonth",date:this.viewDate}),3<=this.viewSelect&&this._setDate(s(b,c,d,k,l,g,0));else if(a.is(".year"))this.viewDate.setUTCDate(1),b=parseInt(a.text(),10)||0,this.viewDate.setUTCFullYear(b),this.element.trigger({type:"changeYear",date:this.viewDate}),4<=this.viewSelect&&this._setDate(s(b,c,d,k,l,g,0));else if(a.is(".hour")){k=parseInt(a.text(),10)||0;if(a.hasClass("hour_am")|| a.hasClass("hour_pm"))12==k&&a.hasClass("hour_am")?k=0:12!=k&&a.hasClass("hour_pm")&&(k+=12);this.viewDate.setUTCHours(k);this.element.trigger({type:"changeHour",date:this.viewDate});1<=this.viewSelect&&this._setDate(s(b,c,d,k,l,g,0))}else a.is(".minute")&&(l=parseInt(a.text().substr(a.text().indexOf(":")+1),10)||0,this.viewDate.setUTCMinutes(l),this.element.trigger({type:"changeMinute",date:this.viewDate}),0<=this.viewSelect&&this._setDate(s(b,c,d,k,l,g,0)));0!=this.viewMode?(a=this.viewMode,this.showMode(-1), this.fill(),a==this.viewMode&&this.autoclose&&this.hide()):(this.fill(),this.autoclose&&this.hide())}break;case "td":a.is(".day")&&!a.is(".disabled")&&(d=parseInt(a.text(),10)||1,b=this.viewDate.getUTCFullYear(),c=this.viewDate.getUTCMonth(),k=this.viewDate.getUTCHours(),l=this.viewDate.getUTCMinutes(),g=this.viewDate.getUTCSeconds(),a.is(".old")?0===c?(c=11,b-=1):c-=1:a.is(".new")&&(11==c?(c=0,b+=1):c+=1),this.viewDate.setUTCFullYear(b),this.viewDate.setUTCMonth(c,d),this.element.trigger({type:"changeDay", date:this.viewDate}),2<=this.viewSelect&&this._setDate(s(b,c,d,k,l,g,0))),a=this.viewMode,this.showMode(-1),this.fill(),a==this.viewMode&&this.autoclose&&this.hide()}},_setDate:function(a,b){b&&"date"!=b||(this.date=a);b&&"view"!=b||(this.viewDate=a);this.fill();this.setValue();var c;this.isInput?c=this.element:this.component&&(c=this.element.find("input"));c&&c.change();this.element.trigger({type:"changeDate",date:this.date})},moveMinute:function(a,b){if(!b)return a;var c=new Date(a.valueOf());c.setUTCMinutes(c.getUTCMinutes()+ b*this.minuteStep);return c},moveHour:function(a,b){if(!b)return a;var c=new Date(a.valueOf());c.setUTCHours(c.getUTCHours()+b);return c},moveDate:function(a,b){if(!b)return a;var c=new Date(a.valueOf());c.setUTCDate(c.getUTCDate()+b);return c},moveMonth:function(a,b){if(!b)return a;var c=new Date(a.valueOf()),d=c.getUTCDate(),k=c.getUTCMonth(),f=Math.abs(b),e;b=0e||11< e)e=(e+12)%12}else{for(var g=0;g=this.startDate&&a<=this.endDate},keydown:function(a){if(this.picker.is(":not(:visible)"))27==a.keyCode&&this.show();else{var b=!1,c,d,f;switch(a.keyCode){case 27:this.hide();a.preventDefault();break;case 37:case 39:if(!this.keyboardNavigation)break; c=37==a.keyCode?-1:1;viewMode=this.viewMode;a.ctrlKey?viewMode+=2:a.shiftKey&&(viewMode+=1);4==viewMode?(d=this.moveYear(this.date,c),f=this.moveYear(this.viewDate,c)):3==viewMode?(d=this.moveMonth(this.date,c),f=this.moveMonth(this.viewDate,c)):2==viewMode?(d=this.moveDate(this.date,c),f=this.moveDate(this.viewDate,c)):1==viewMode?(d=this.moveHour(this.date,c),f=this.moveHour(this.viewDate,c)):0==viewMode&&(d=this.moveMinute(this.date,c),f=this.moveMinute(this.viewDate,c));this.dateWithinRange(d)&& (this.date=d,this.viewDate=f,this.setValue(),this.update(),a.preventDefault(),b=!0);break;case 38:case 40:if(!this.keyboardNavigation)break;c=38==a.keyCode?-1:1;viewMode=this.viewMode;a.ctrlKey?viewMode+=2:a.shiftKey&&(viewMode+=1);4==viewMode?(d=this.moveYear(this.date,c),f=this.moveYear(this.viewDate,c)):3==viewMode?(d=this.moveMonth(this.date,c),f=this.moveMonth(this.viewDate,c)):2==viewMode?(d=this.moveDate(this.date,7*c),f=this.moveDate(this.viewDate,7*c)):1==viewMode?this.showMeridian?(d=this.moveHour(this.date, 6*c),f=this.moveHour(this.viewDate,6*c)):(d=this.moveHour(this.date,4*c),f=this.moveHour(this.viewDate,4*c)):0==viewMode&&(d=this.moveMinute(this.date,4*c),f=this.moveMinute(this.viewDate,4*c));this.dateWithinRange(d)&&(this.date=d,this.viewDate=f,this.setValue(),this.update(),a.preventDefault(),b=!0);break;case 13:0!=this.viewMode?(c=this.viewMode,this.showMode(-1),this.fill(),c==this.viewMode&&this.autoclose&&this.hide()):(this.fill(),this.autoclose&&this.hide());a.preventDefault();break;case 9:this.hide()}if(b){var e; this.isInput?e=this.element:this.component&&(e=this.element.find("input"));e&&e.change();this.element.trigger({type:"changeDate",date:this.date})}}},showMode:function(a){a&&(a=Math.max(0,Math.min(e.modes.length-1,this.viewMode+a)),a>=this.minView&&a<=this.maxView&&(this.element.trigger({type:"changeMode",date:this.viewDate,oldViewMode:this.viewMode,newViewMode:a}),this.viewMode=a));this.picker.find(">div").hide().filter(".datetimepicker-"+e.modes[this.viewMode].clsName).css("display","block");this.updateNavArrows()}, reset:function(a){this._setDate(null,"date")},convertViewModeText:function(a){switch(a){case 4:return"decade";case 3:return"year";case 2:return"month";case 1:return"day";case 0:return"hour"}}};f.fn.datetimepicker=function(a){var b=Array.apply(null,arguments);b.shift();var c;this.each(function(){var d=f(this),e=d.data("datetimepicker"),g="object"==typeof a&&a;e||d.data("datetimepicker",e=new u(this,f.extend({},f.fn.datetimepicker.defaults,g)));if("string"==typeof a&&"function"==typeof e[a]&&(c=e[a].apply(e, b),void 0!==c))return!1});return void 0!==c?c:this};f.fn.datetimepicker.defaults={};f.fn.datetimepicker.Constructor=u;var g=f.fn.datetimepicker.dates={en:{days:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),daysShort:"Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),daysMin:"Su Mo Tu We Th Fr Sa Su".split(" "),months:"January February March April May June July August September October November December".split(" "),monthsShort:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "), meridiem:["am","pm"],suffix:["st","nd","rd","th"],today:"Today"}},e={modes:[{clsName:"minutes",navFnc:"Hours",navStep:1},{clsName:"hours",navFnc:"Date",navStep:1},{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(a){return 0===a%4&&0!==a%100||0===a%400},getDaysInMonth:function(a,b){return[31,e.isLeapYear(a)?29:28,31,30,31,30,31,31,30,31,30,31][b]},getDefaultFormat:function(a,b){if("standard"== a)return"input"==b?"yyyy-mm-dd hh:ii":"yyyy-mm-dd hh:ii:ss";if("php"==a)return"input"==b?"Y-m-d H:i":"Y-m-d H:i:s";throw Error("Invalid format type.");},validParts:function(a){if("standard"==a)return/hh?|HH?|p|P|ii?|ss?|dd?|DD?|mm?|MM?|yy(?:yy)?/g;if("php"==a)return/[dDjlNwzFmMnStyYaABgGhHis]/g;throw Error("Invalid format type.");},nonpunctuation:/[^ -\/:-@\[-`{-~\t\n\rTZ]+/g,parseFormat:function(a,b){var c=a.replace(this.validParts(b),"\x00").split("\x00"),d=a.match(this.validParts(b));if(!c||!c.length|| !d||0==d.length)throw Error("Invalid date format.");return{separators:c,parts:d}},parseDate:function(a,b,c,d){if(a instanceof Date)return a=new Date(a.valueOf()-6E4*a.getTimezoneOffset()),a.setMilliseconds(0),a;/^\d{4}\-\d{1,2}\-\d{1,2}$/.test(a)&&(b=this.parseFormat("yyyy-mm-dd",d));/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}$/.test(a)&&(b=this.parseFormat("yyyy-mm-dd hh:ii",d));/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}\:\d{1,2}[Z]{0,1}$/.test(a)&&(b=this.parseFormat("yyyy-mm-dd hh:ii:ss", d));if(/^[-+]\d+[dmwy]([\s,]+[-+]\d+[dmwy])*$/.test(a)){b=/([-+]\d+)([dmwy])/;var e=a.match(/([-+]\d+)([dmwy])/g);a=new Date;for(var l=0;lb;)b+=12;b%=12;for(a.setUTCMonth(b);a.getUTCMonth()!=b&&!isNaN(a.getUTCMonth());)a.setUTCDate(a.getUTCDate()-1);return a},d:function(a,b){return a.setUTCDate(b)},p:function(a,b){return a.setUTCHours(1==b?a.getUTCHours()+12:a.getUTCHours())}},h;t.M=t.MM=t.mm=t.m;t.dd=t.d;t.P=t.p;a=s(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds());if(e.length== b.parts.length){for(var l=0,r=b.parts.length;la.getUTCHours()?0:1]:"",h:a.getUTCHours(),i:a.getUTCMinutes(), s:a.getUTCSeconds()},d.H=2==g[c].meridiem.length?0==d.h%12?12:d.h%12:d.h,d.HH=(10>d.H?"0":"")+d.H,d.P=d.p.toUpperCase(),d.hh=(10>d.h?"0":"")+d.h,d.ii=(10>d.i?"0":"")+d.i,d.ss=(10>d.s?"0":"")+d.s,d.dd=(10>d.d?"0":"")+d.d,d.mm=(10>d.m?"0":"")+d.m;else if("php"==d)d={y:a.getUTCFullYear().toString().substring(2),Y:a.getUTCFullYear(),F:g[c].months[a.getUTCMonth()],M:g[c].monthsShort[a.getUTCMonth()],n:a.getUTCMonth()+1,t:e.getDaysInMonth(a.getUTCFullYear(),a.getUTCMonth()),j:a.getUTCDate(),l:g[c].days[a.getUTCDay()], D:g[c].daysShort[a.getUTCDay()],w:a.getUTCDay(),N:0==a.getUTCDay()?7:a.getUTCDay(),S:a.getUTCDate()%10<=g[c].suffix.length?g[c].suffix[a.getUTCDate()%10-1]:"",a:2==g[c].meridiem.length?g[c].meridiem[12>a.getUTCHours()?0:1]:"",g:0==a.getUTCHours()%12?12:a.getUTCHours()%12,G:a.getUTCHours(),i:a.getUTCMinutes(),s:a.getUTCSeconds()},d.m=(10>d.n?"0":"")+d.n,d.d=(10>d.j?"0":"")+d.j,d.A=d.a.toString().toUpperCase(),d.h=(10>d.g?"0":"")+d.g,d.H=(10>d.G?"0":"")+d.G,d.i=(10>d.i?"0":"")+d.i,d.s=(10>d.s?"0":"")+ d.s;else throw Error("Invalid format type.");a=[];c=f.extend([],b.separators);for(var k=0,l=b.parts.length;k', headTemplateV3:' ',contTemplate:'',footTemplate:''};e.template='
'+e.headTemplate+e.contTemplate+e.footTemplate+ '
'+e.headTemplate+e.contTemplate+e.footTemplate+'
'+e.headTemplate+""+e.footTemplate+'
'+e.headTemplate+e.contTemplate+e.footTemplate+'
'+e.headTemplate+e.contTemplate+e.footTemplate+ "
";e.templateV3='
'+e.headTemplateV3+e.contTemplate+e.footTemplate+'
'+e.headTemplateV3+e.contTemplate+e.footTemplate+'
'+e.headTemplateV3+""+e.footTemplate+'
'+ e.headTemplateV3+e.contTemplate+e.footTemplate+'
'+e.headTemplateV3+e.contTemplate+e.footTemplate+"
";f.fn.datetimepicker.DPGlobal=e;f.fn.datetimepicker.noConflict=function(){f.fn.datetimepicker=old;return this};f(document).on("focus.datetimepicker.data-api click.datetimepicker.data-api",'[data-provide="datetimepicker"]',function(a){var b=f(this);b.data("datetimepicker")||(a.preventDefault(),b.datetimepicker("show"))}); f(function(){f('[data-provide="datetimepicker-inline"]').datetimepicker()})}(window.jQuery);