You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
29 KiB
29 lines
29 KiB
4 years ago
|
/*
|
||
|
Version 3.0.0
|
||
|
=========================================================
|
||
|
bootstrap-datetimepicker.js
|
||
|
https://github.com/Eonasdan/bootstrap-datetimepicker
|
||
|
=========================================================
|
||
|
The MIT License (MIT)
|
||
|
|
||
|
Copyright (c) 2014 Jonathan Peterson
|
||
|
|
||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
|
of this software and associated documentation files (the "Software"), to deal
|
||
|
in the Software without restriction, including without limitation the rights
|
||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||
|
copies of the Software, and to permit persons to whom the Software is
|
||
|
furnished to do so, subject to the following conditions:
|
||
|
|
||
|
The above copyright notice and this permission notice shall be included in
|
||
|
all copies or substantial portions of the Software.
|
||
|
|
||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||
|
THE SOFTWARE.
|
||
|
*/
|
||
|
(function(d,g){var r="«";var a="»";var l=d(window);function o(){return new Date(Date.UTC.apply(Date,arguments))}function c(){var s=new Date();return o(s.getFullYear(),s.getMonth(),s.getDate())}function m(s){return function(){return this[s].apply(this,arguments)}}var n=(function(){var s={get:function(t){return this.slice(t)[0]},contains:function(w){var v=w&&w.valueOf();for(var u=0,t=this.length;u<t;u++){if(this[u].valueOf()===v){return u}}return -1},remove:function(t){this.splice(t,1)},replace:function(t){if(!t){return}if(!d.isArray(t)){t=[t]}this.clear();this.push.apply(this,t)},clear:function(){this.length=0},copy:function(){var t=new n();t.replace(this);return t}};return function(){var t=[];t.push.apply(t,arguments);d.extend(t,s);return t}})();var q=function(t,s){this.dates=new n();this.viewDate=c();this.focusDate=null;this._process_options(s);this.element=d(t);this.isInline=false;this.isInput=this.element.is("input");this.component=this.element.is(".date")?this.element.find(".add-on, .input-group-addon, .btn"):false;this.hasInput=this.component&&this.element.find("input").length;if(this.component&&this.component.length===0){this.component=false}this.picker=d(h.template);this._buildEvents();this._attachEvents();if(this.isInline){this.picker.addClass("datepicker-inline").appendTo(this.element)}else{this.picker.addClass("datepicker-dropdown dropdown-menu")}if(this.o.rtl){this.picker.addClass("datepicker-rtl")}this.viewMode=this.o.startView;if(this.o.calendarWeeks){this.picker.find("tfoot th.today").attr("colspan",function(u,v){return parseInt(v)+1})}this._allow_update=false;this.setStartDate(this._o.startDate);this.setEndDate(this._o.endDate);this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled);this.fillDow();this.fillMonths();this._allow_update=true;this.update();this.showMode();if(this.isInline){this.show()}};q.prototype={constructor:q,_process_options:function(s){this._o=d.extend({},this._o,s);var w=this.o=d.extend({},this._o);var v=w.language;if(!f[v]){v=v.split("-")[0];if(!f[v]){v=i.language}}w.language=v;switch(w.startView){case 2:case"decade":w.startView=2;break;case 1:case"year":w.startView=1;break;default:w.startView=0}switch(w.minViewMode){case 1:case"months":w.minViewMode=1;break;case 2:case"years":w.minViewMode=2;break;default:w.minViewMode=0}w.startView=Math.max(w.startView,w.minViewMode);if(w.multidate!==true){w.multidate=Number(w.multidate)||false;if(w.multidate!==false){w.multidate=Math.max(0,w.multidate)}else{w.multidate=1}}w.multidateSeparator=String(w.multidateSeparator);w.weekStart%=7;w.weekEnd=((w.weekStart+6)%7);var t=h.parseFormat(w.format);if(w.startDate!==-Infinity){if(!!w.startDate){if(w.startDate instanceof Date){w.startDate=this._local_to_utc(this._zero_time(w.startDate))}else{w.startDate=h.parseDate(w.startDate,t,w.language)}}else{w.startDate=-Infinity}}if(w.endDate!==Infinity){if(!!w.endDate){if(w.endDate instanceof Date){w.endDate=this._local_to_utc(this._zero_time(w.endDate))}else{w.endDate=h.parseDate(w.endDate,t,w.language)}}else{w.endDate=Infinity}}w.daysOfWeekDisabled=w.daysOfWeekDisabled||[];if(!d.isArray(w.daysOfWeekDisabled)){w.daysOfWeekDisabled=w.daysOfWeekDisabled.split(/[,\s]*/)}w.daysOfWeekDisabled=d.map(w.daysOfWeekDisabled,function(y){return parseInt(y,10)});var u=String(w.orientation).toLowerCase().split(/\s+/g),x=w.orientation.toLowerCase();u=d.grep(u,function(y){return(/^auto|left|right|top|bottom$/).test(y)});w.orientation={x:"auto",y:"auto"};if(!x||x==="auto"){}else{if(u.length===1){switch(u[0]){case"top":case"bottom":w.orientation.y=u[0];break;case"left":case"right":w.orientation.x=u[0];break}}else{x=d.grep(u,function(y){return(/^left|right$/).test(y)});w.orientation.x=x[0]||"auto";x=d.grep(u,function(y){return(/^top|bottom$/).test(y)});w.orientation.y=x[0]||"auto"}}},_events:[],_secondaryEvents:[],_applyEvents:function(s){for(var t=0,v,u,w;t<s.length;t++){v=s[t][0];if(s[t].length===2){u=g;w=s[t][1]}else{if(s[t].length===3){u=s[t][1];w=s[t][2]}}v.on(w,u)}},_unapplyEvents:function(s){for(var t=0,v,w,u;t<s.length;t++){v=s[t][0];if(s[t].length===2){u=g;w=s[t]
|