tempusdominus-core
Advanced tools
Comparing version 5.0.0 to 5.0.2
@@ -82,4 +82,3 @@ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var MinViewModeNumber = 0, | ||
Default = { | ||
var Default = { | ||
timeZone: '', | ||
@@ -320,2 +319,3 @@ format: false, | ||
this.currentViewMode = null; | ||
this.MinViewModeNumber = 0; | ||
@@ -553,3 +553,3 @@ this._int(); | ||
if (dir) { | ||
this.currentViewMode = Math.max(MinViewModeNumber, Math.min(3, this.currentViewMode + dir)); | ||
this.currentViewMode = Math.max(this.MinViewModeNumber, Math.min(3, this.currentViewMode + dir)); | ||
} | ||
@@ -730,12 +730,12 @@ this.widget.find('.datepicker > div').hide().filter('.datepicker-' + DatePickerModes[this.currentViewMode].CLASS_NAME).show(); | ||
if (this._isEnabled('y')) { | ||
MinViewModeNumber = 2; | ||
this.MinViewModeNumber = 2; | ||
} | ||
if (this._isEnabled('M')) { | ||
MinViewModeNumber = 1; | ||
this.MinViewModeNumber = 1; | ||
} | ||
if (this._isEnabled('d')) { | ||
MinViewModeNumber = 0; | ||
this.MinViewModeNumber = 0; | ||
} | ||
this.currentViewMode = Math.max(MinViewModeNumber, this.currentViewMode); | ||
this.currentViewMode = Math.max(this.MinViewModeNumber, this.currentViewMode); | ||
@@ -1207,3 +1207,3 @@ if (!this.unset) { | ||
this._options.viewMode = _viewMode; | ||
this.currentViewMode = Math.max(DateTimePicker.ViewModes.indexOf(_viewMode) - 1, DateTimePicker.MinViewModeNumber); | ||
this.currentViewMode = Math.max(DateTimePicker.ViewModes.indexOf(_viewMode) - 1, this.MinViewModeNumber); | ||
@@ -1518,13 +1518,3 @@ this._showMode(); | ||
} | ||
/** | ||
* @return {number} | ||
*/ | ||
}, { | ||
key: 'MinViewModeNumber', | ||
get: function get() { | ||
return MinViewModeNumber; | ||
} | ||
}, { | ||
key: 'Event', | ||
@@ -1531,0 +1521,0 @@ get: function get() { |
@@ -1,1 +0,1 @@ | ||
var _createClass=function(){function o(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t}}();function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var DateTimePicker=function(s,i){var t="datetimepicker",e=""+t,o="."+e,a=".data-api",r={DATA_TOGGLE:'[data-toggle="'+e+'"]'},p={INPUT:t+"-input"},h={CHANGE:"change"+o,BLUR:"blur"+o,KEYUP:"keyup"+o,KEYDOWN:"keydown"+o,FOCUS:"focus"+o,CLICK_DATA_API:"click"+o+a,UPDATE:"update"+o,ERROR:"error"+o,HIDE:"hide"+o,SHOW:"show"+o},d=[{CLASS_NAME:"days",NAV_FUNCTION:"M",NAV_STEP:1},{CLASS_NAME:"months",NAV_FUNCTION:"y",NAV_STEP:1},{CLASS_NAME:"years",NAV_FUNCTION:"y",NAV_STEP:10},{CLASS_NAME:"decades",NAV_FUNCTION:"y",NAV_STEP:100}],l={up:38,38:"up",down:40,40:"down",left:37,37:"left",right:39,39:"right",tab:9,9:"tab",escape:27,27:"escape",enter:13,13:"enter",pageUp:33,33:"pageUp",pageDown:34,34:"pageDown",shift:16,16:"shift",control:17,17:"control",space:32,32:"space",t:84,84:"t",delete:46,46:"delete"},u=["times","days","months","years","decades"],f={},c={},_=0,m={timeZone:"",format:!1,dayViewHeaderFormat:"MMMM YYYY",extraFormats:!1,stepping:1,minDate:!1,maxDate:!1,useCurrent:!0,collapse:!0,locale:i.locale(),defaultDate:!1,disabledDates:!1,enabledDates:!1,icons:{time:"fa fa-clock-o",date:"fa fa-calendar",up:"fa fa-arrow-up",down:"fa fa-arrow-down",previous:"fa fa-chevron-left",next:"fa fa-chevron-right",today:"fa fa-calendar-check-o",clear:"fa fa-delete",close:"fa fa-times"},tooltips:{today:"Go to today",clear:"Clear selection",close:"Close the picker",selectMonth:"Select Month",prevMonth:"Previous Month",nextMonth:"Next Month",selectYear:"Select Year",prevYear:"Previous Year",nextYear:"Next Year",selectDecade:"Select Decade",prevDecade:"Previous Decade",nextDecade:"Next Decade",prevCentury:"Previous Century",nextCentury:"Next Century",pickHour:"Pick Hour",incrementHour:"Increment Hour",decrementHour:"Decrement Hour",pickMinute:"Pick Minute",incrementMinute:"Increment Minute",decrementMinute:"Decrement Minute",pickSecond:"Pick Second",incrementSecond:"Increment Second",decrementSecond:"Decrement Second",togglePeriod:"Toggle Period",selectTime:"Select Time",selectDate:"Select Date"},useStrict:!1,sideBySide:!1,daysOfWeekDisabled:!1,calendarWeeks:!1,viewMode:"days",toolbarPlacement:"default",buttons:{showToday:!1,showClear:!1,showClose:!1},widgetPositioning:{horizontal:"auto",vertical:"auto"},widgetParent:null,ignoreReadonly:!1,keepOpen:!1,focusOnShow:!0,inline:!1,keepInvalid:!1,keyBinds:{up:function(){if(!this.widget)return!1;var t=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")?this.date(t.clone().subtract(7,"d")):this.date(t.clone().add(this.stepping(),"m")),!0},down:function(){if(!this.widget)return this.show(),!1;var t=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")?this.date(t.clone().add(7,"d")):this.date(t.clone().subtract(this.stepping(),"m")),!0},"control up":function(){if(!this.widget)return!1;var t=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")?this.date(t.clone().subtract(1,"y")):this.date(t.clone().add(1,"h")),!0},"control down":function(){if(!this.widget)return!1;var t=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")?this.date(t.clone().add(1,"y")):this.date(t.clone().subtract(1,"h")),!0},left:function(){if(!this.widget)return!1;var t=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")&&this.date(t.clone().subtract(1,"d")),!0},right:function(){if(!this.widget)return!1;var t=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")&&this.date(t.clone().add(1,"d")),!0},pageUp:function(){if(!this.widget)return!1;var t=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")&&this.date(t.clone().subtract(1,"M")),!0},pageDown:function(){if(!this.widget)return!1;var t=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")&&this.date(t.clone().add(1,"M")),!0},enter:function(){return!!this.widget&&(this.hide(),!0)},escape:function(){return!!this.widget&&(this.hide(),!0)},"control space":function(){return!!this.widget&&(this.widget.find(".timepicker").is(":visible")&&this.widget.find('.btn[data-action="togglePeriod"]').click(),!0)},t:function(){return!!this.widget&&(this.date(this.getMoment()),!0)},delete:function(){return!!this.widget&&(this.clear(),!0)}},debug:!1,allowInputToggle:!1,disabledTimeIntervals:!1,disabledHours:!1,enabledHours:!1,viewDate:!1,allowMultidate:!1,multidateSeparator:","};return function(){function n(t,e){_classCallCheck(this,n),this._options=this._getOptions(e),this._element=t,this._dates=[],this._datesFormatted=[],this._viewDate=null,this.unset=!0,this.component=!1,this.widget=!1,this.use24Hours=null,this.actualFormat=null,this.parseFormats=null,this.currentViewMode=null,this._int()}return n.prototype._int=function(){var t=this._element.data("target-input");this._element.is("input")?this.input=this._element:void 0!==t&&(this.input="nearest"===t?this._element.find("input"):s(t)),this._dates=[],this._dates[0]=this.getMoment(),this._viewDate=this.getMoment().clone(),s.extend(!0,this._options,this._dataToOptions()),this.options(this._options),this._initFormatting(),void 0!==this.input&&this.input.is("input")&&0!==this.input.val().trim().length?this._setValue(this._parseInputDate(this.input.val().trim()),0):this._options.defaultDate&&void 0!==this.input&&void 0===this.input.attr("placeholder")&&this._setValue(this._options.defaultDate,0),this._options.inline&&this.show()},n.prototype._update=function(){this.widget&&(this._fillDate(),this._fillTime())},n.prototype._setValue=function(t,e){var i=this.unset?null:this._dates[e],o="";if(!t)return this._options.allowMultidate&&1!==this._dates.length?(o=(o=this._element.data("date")+",").replace(i.format(this.actualFormat)+",","").replace(",,","").replace(/,\s*$/,""),this._dates.splice(e,1),this._datesFormatted.splice(e,1)):(this.unset=!0,this._dates=[],this._datesFormatted=[]),void 0!==this.input&&(this.input.val(o),this.input.trigger("input")),this._element.data("date",o),this._notifyEvent({type:n.Event.CHANGE,date:!1,oldDate:i}),void this._update();if(t=t.clone().locale(this._options.locale),this._hasTimeZone()&&t.tz(this._options.timeZone),1!==this._options.stepping&&t.minutes(Math.round(t.minutes()/this._options.stepping)*this._options.stepping).seconds(0),this._isValid(t)){if(this._dates[e]=t,this._datesFormatted[e]=t.format("YYYY-MM-DD"),this._viewDate=t.clone(),this._options.allowMultidate&&1<this._dates.length){for(var s=0;s<this._dates.length;s++)o+=""+this._dates[s].format(this.actualFormat)+this._options.multidateSeparator;o=o.replace(/,\s*$/,"")}else o=this._dates[e].format(this.actualFormat);void 0!==this.input&&(this.input.val(o),this.input.trigger("input")),this._element.data("date",o),this.unset=!1,this._update(),this._notifyEvent({type:n.Event.CHANGE,date:this._dates[e].clone(),oldDate:i})}else this._options.keepInvalid?this._notifyEvent({type:n.Event.CHANGE,date:t,oldDate:i}):void 0!==this.input&&(this.input.val(""+(this.unset?"":this._dates[e].format(this.actualFormat))),this.input.trigger("input")),this._notifyEvent({type:n.Event.ERROR,date:t,oldDate:i})},n.prototype._change=function(t){var e=s(t.target).val().trim(),i=e?this._parseInputDate(e):null;return this._setValue(i),t.stopImmediatePropagation(),!1},n.prototype._getOptions=function(t){return t=s.extend(!0,{},m,t)},n.prototype._hasTimeZone=function(){return void 0!==i.tz&&void 0!==this._options.timeZone&&null!==this._options.timeZone&&""!==this._options.timeZone},n.prototype._isEnabled=function(t){if("string"!=typeof t||1<t.length)throw new TypeError("isEnabled expects a single character string parameter");switch(t){case"y":return-1!==this.actualFormat.indexOf("Y");case"M":return-1!==this.actualFormat.indexOf("M");case"d":return-1!==this.actualFormat.toLowerCase().indexOf("d");case"h":case"H":return-1!==this.actualFormat.toLowerCase().indexOf("h");case"m":return-1!==this.actualFormat.indexOf("m");case"s":return-1!==this.actualFormat.indexOf("s");case"a":case"A":return-1!==this.actualFormat.toLowerCase().indexOf("a");default:return!1}},n.prototype._hasTime=function(){return this._isEnabled("h")||this._isEnabled("m")||this._isEnabled("s")},n.prototype._hasDate=function(){return this._isEnabled("y")||this._isEnabled("M")||this._isEnabled("d")},n.prototype._dataToOptions=function(){var i=this._element.data(),o={};return i.dateOptions&&i.dateOptions instanceof Object&&(o=s.extend(!0,o,i.dateOptions)),s.each(this._options,function(t){var e="date"+t.charAt(0).toUpperCase()+t.slice(1);void 0!==i[e]?o[t]=i[e]:delete o[t]}),o},n.prototype._notifyEvent=function(t){t.type===n.Event.CHANGE&&t.date&&t.date.isSame(t.oldDate)||!t.date&&!t.oldDate||this._element.trigger(t)},n.prototype._viewUpdate=function(t){"y"===t&&(t="YYYY"),this._notifyEvent({type:n.Event.UPDATE,change:t,viewDate:this._viewDate.clone()})},n.prototype._showMode=function(t){this.widget&&(t&&(this.currentViewMode=Math.max(_,Math.min(3,this.currentViewMode+t))),this.widget.find(".datepicker > div").hide().filter(".datepicker-"+d[this.currentViewMode].CLASS_NAME).show())},n.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},n.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},n.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},n.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},n.prototype._isValid=function(t,e){if(!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},n.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?i.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},n.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in f[p]="p",f)f.hasOwnProperty(i)&&"p"===f[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&l[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(l[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},n.prototype._keyup=function(t){f[t.which]="r",c[t.which]&&(c[t.which]=!1,t.stopPropagation(),t.preventDefault())},n.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},n.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},n.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return e._dates[0].localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(_=2),this._isEnabled("M")&&(_=1),this._isEnabled("d")&&(_=0),this.currentViewMode=Math.max(_,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},n.prototype._getLastPickedDate=function(){return this._dates[this._getLastPickedDateIndex()]},n.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},n.prototype.getMoment=function(t){var e=void 0;return e=null==t?i():this._hasTimeZone()?i.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):i(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},n.prototype.toggle=function(){return this.widget?this.hide():this.show()},n.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},n.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var i=this;s.each(this._options,function(t,e){void 0!==i[t]&&i[t](e)})},n.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||i.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");this._setValue(null===t?null:this._parseInputDate(t),e)},n.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},n.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},n.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},n.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},n.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},n.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},n.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e<this._dates.length;e++){for(var i=0;!this._isValid(this._dates[e],"d");){if(this._dates[e].add(1,"d"),31===i)throw"Tried 31 times to find a valid date";i++}this._setValue(this._dates[e],e)}this._update()},n.prototype.maxDate=function(t){if(0===arguments.length)return this._options.maxDate?this._options.maxDate.clone():this._options.maxDate;if("boolean"==typeof t&&!1===t)return this._options.maxDate=!1,this._update(),!0;"string"==typeof t&&("now"!==t&&"moment"!==t||(t=this.getMoment()));var e=this._parseInputDate(t);if(!e.isValid())throw new TypeError("maxDate() Could not parse date parameter: "+t);if(this._options.minDate&&e.isBefore(this._options.minDate))throw new TypeError("maxDate() date parameter is before this.options.minDate: "+e.format(this.actualFormat));this._options.maxDate=e;for(var i=0;i<this._dates.length;i++)this._options.useCurrent&&!this._options.keepInvalid&&this._dates[i].isAfter(t)&&this._setValue(this._options.maxDate,i);this._viewDate.isAfter(e)&&(this._viewDate=e.clone().subtract(this._options.stepping,"m")),this._update()},n.prototype.minDate=function(t){if(0===arguments.length)return this._options.minDate?this._options.minDate.clone():this._options.minDate;if("boolean"==typeof t&&!1===t)return this._options.minDate=!1,this._update(),!0;"string"==typeof t&&("now"!==t&&"moment"!==t||(t=this.getMoment()));var e=this._parseInputDate(t);if(!e.isValid())throw new TypeError("minDate() Could not parse date parameter: "+t);if(this._options.maxDate&&e.isAfter(this._options.maxDate))throw new TypeError("minDate() date parameter is after this.options.maxDate: "+e.format(this.actualFormat));this._options.minDate=e;for(var i=0;i<this._dates.length;i++)this._options.useCurrent&&!this._options.keepInvalid&&this._dates[i].isBefore(t)&&this._setValue(this._options.minDate,i);this._viewDate.isBefore(e)&&(this._viewDate=e.clone().add(this._options.stepping,"m")),this._update()},n.prototype.defaultDate=function(t){if(0===arguments.length)return this._options.defaultDate?this._options.defaultDate.clone():this._options.defaultDate;if(!t)return!(this._options.defaultDate=!1);"string"==typeof t&&(t="now"===t||"moment"===t?this.getMoment():this.getMoment(t));var e=this._parseInputDate(t);if(!e.isValid())throw new TypeError("defaultDate() Could not parse date parameter: "+t);if(!this._isValid(e))throw new TypeError("defaultDate() date passed is invalid according to component setup validations");this._options.defaultDate=e,(this._options.defaultDate&&this._options.inline||void 0!==this.input&&""===this.input.val().trim())&&this._setValue(this._options.defaultDate,0)},n.prototype.locale=function(t){if(0===arguments.length)return this._options.locale;if(!i.localeData(t))throw new TypeError("locale() locale "+t+" is not loaded from moment locales!");this._options.locale=t;for(var e=0;e<this._dates.length;e++)this._dates[e].locale(this._options.locale);this._viewDate.locale(this._options.locale),this.actualFormat&&this._initFormatting(),this.widget&&(this.hide(),this.show())},n.prototype.stepping=function(t){if(0===arguments.length)return this._options.stepping;t=parseInt(t,10),(isNaN(t)||t<1)&&(t=1),this._options.stepping=t},n.prototype.useCurrent=function(t){var e=["year","month","day","hour","minute"];if(0===arguments.length)return this._options.useCurrent;if("boolean"!=typeof t&&"string"!=typeof t)throw new TypeError("useCurrent() expects a boolean or string parameter");if("string"==typeof t&&-1===e.indexOf(t.toLowerCase()))throw new TypeError("useCurrent() expects a string parameter of "+e.join(", "));this._options.useCurrent=t},n.prototype.collapse=function(t){if(0===arguments.length)return this._options.collapse;if("boolean"!=typeof t)throw new TypeError("collapse() expects a boolean parameter");if(this._options.collapse===t)return!0;this._options.collapse=t,this.widget&&(this.hide(),this.show())},n.prototype.icons=function(t){if(0===arguments.length)return s.extend({},this._options.icons);if(!(t instanceof Object))throw new TypeError("icons() expects parameter to be an Object");s.extend(this._options.icons,t),this.widget&&(this.hide(),this.show())},n.prototype.tooltips=function(t){if(0===arguments.length)return s.extend({},this._options.tooltips);if(!(t instanceof Object))throw new TypeError("tooltips() expects parameter to be an Object");s.extend(this._options.tooltips,t),this.widget&&(this.hide(),this.show())},n.prototype.useStrict=function(t){if(0===arguments.length)return this._options.useStrict;if("boolean"!=typeof t)throw new TypeError("useStrict() expects a boolean parameter");this._options.useStrict=t},n.prototype.sideBySide=function(t){if(0===arguments.length)return this._options.sideBySide;if("boolean"!=typeof t)throw new TypeError("sideBySide() expects a boolean parameter");this._options.sideBySide=t,this.widget&&(this.hide(),this.show())},n.prototype.viewMode=function(t){if(0===arguments.length)return this._options.viewMode;if("string"!=typeof t)throw new TypeError("viewMode() expects a string parameter");if(-1===n.ViewModes.indexOf(t))throw new TypeError("viewMode() parameter must be one of ("+n.ViewModes.join(", ")+") value");this._options.viewMode=t,this.currentViewMode=Math.max(n.ViewModes.indexOf(t)-1,n.MinViewModeNumber),this._showMode()},n.prototype.calendarWeeks=function(t){if(0===arguments.length)return this._options.calendarWeeks;if("boolean"!=typeof t)throw new TypeError("calendarWeeks() expects parameter to be a boolean value");this._options.calendarWeeks=t,this._update()},n.prototype.buttons=function(t){if(0===arguments.length)return s.extend({},this._options.buttons);if(!(t instanceof Object))throw new TypeError("buttons() expects parameter to be an Object");if(s.extend(this._options.buttons,t),"boolean"!=typeof this._options.buttons.showToday)throw new TypeError("buttons.showToday expects a boolean parameter");if("boolean"!=typeof this._options.buttons.showClear)throw new TypeError("buttons.showClear expects a boolean parameter");if("boolean"!=typeof this._options.buttons.showClose)throw new TypeError("buttons.showClose expects a boolean parameter");this.widget&&(this.hide(),this.show())},n.prototype.keepOpen=function(t){if(0===arguments.length)return this._options.keepOpen;if("boolean"!=typeof t)throw new TypeError("keepOpen() expects a boolean parameter");this._options.keepOpen=t},n.prototype.focusOnShow=function(t){if(0===arguments.length)return this._options.focusOnShow;if("boolean"!=typeof t)throw new TypeError("focusOnShow() expects a boolean parameter");this._options.focusOnShow=t},n.prototype.inline=function(t){if(0===arguments.length)return this._options.inline;if("boolean"!=typeof t)throw new TypeError("inline() expects a boolean parameter");this._options.inline=t},n.prototype.clear=function(){this._setValue(null)},n.prototype.keyBinds=function(t){if(0===arguments.length)return this._options.keyBinds;this._options.keyBinds=t},n.prototype.debug=function(t){if("boolean"!=typeof t)throw new TypeError("debug() expects a boolean parameter");this._options.debug=t},n.prototype.allowInputToggle=function(t){if(0===arguments.length)return this._options.allowInputToggle;if("boolean"!=typeof t)throw new TypeError("allowInputToggle() expects a boolean parameter");this._options.allowInputToggle=t},n.prototype.keepInvalid=function(t){if(0===arguments.length)return this._options.keepInvalid;if("boolean"!=typeof t)throw new TypeError("keepInvalid() expects a boolean parameter");this._options.keepInvalid=t},n.prototype.datepickerInput=function(t){if(0===arguments.length)return this._options.datepickerInput;if("string"!=typeof t)throw new TypeError("datepickerInput() expects a string parameter");this._options.datepickerInput=t},n.prototype.parseInputDate=function(t){if(0===arguments.length)return this._options.parseInputDate;if("function"!=typeof t)throw new TypeError("parseInputDate() should be as function");this._options.parseInputDate=t},n.prototype.disabledTimeIntervals=function(t){if(0===arguments.length)return this._options.disabledTimeIntervals?s.extend({},this._options.disabledTimeIntervals):this._options.disabledTimeIntervals;if(!t)return this._options.disabledTimeIntervals=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledTimeIntervals() expects an array parameter");this._options.disabledTimeIntervals=t,this._update()},n.prototype.disabledHours=function(t){if(0===arguments.length)return this._options.disabledHours?s.extend({},this._options.disabledHours):this._options.disabledHours;if(!t)return this._options.disabledHours=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledHours() expects an array parameter");if(this._options.disabledHours=this._indexGivenHours(t),this._options.enabledHours=!1,this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e<this._dates.length;e++){for(var i=0;!this._isValid(this._dates[e],"h");){if(this._dates[e].add(1,"h"),24===i)throw"Tried 24 times to find a valid date";i++}this._setValue(this._dates[e],e)}this._update()},n.prototype.enabledHours=function(t){if(0===arguments.length)return this._options.enabledHours?s.extend({},this._options.enabledHours):this._options.enabledHours;if(!t)return this._options.enabledHours=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledHours() expects an array parameter");if(this._options.enabledHours=this._indexGivenHours(t),this._options.disabledHours=!1,this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e<this._dates.length;e++){for(var i=0;!this._isValid(this._dates[e],"h");){if(this._dates[e].add(1,"h"),24===i)throw"Tried 24 times to find a valid date";i++}this._setValue(this._dates[e],e)}this._update()},n.prototype.viewDate=function(t){if(0===arguments.length)return this._viewDate.clone();if(!t)return this._viewDate=(this._dates[0]||this.getMoment()).clone(),!0;if(!("string"==typeof t||i.isMoment(t)||t instanceof Date))throw new TypeError("viewDate() parameter must be one of [string, moment or Date]");this._viewDate=this._parseInputDate(t),this._viewUpdate()},n.prototype.allowMultidate=function(t){if("boolean"!=typeof t)throw new TypeError("allowMultidate() expects a boolean parameter");this._options.allowMultidate=t},n.prototype.multidateSeparator=function(t){if(0===arguments.length)return this._options.multidateSeparator;if("string"!=typeof t||1<t.length)throw new TypeError("multidateSeparator expects a single character string parameter");this._options.multidateSeparator=t},_createClass(n,null,[{key:"NAME",get:function(){return t}},{key:"DATA_KEY",get:function(){return e}},{key:"EVENT_KEY",get:function(){return o}},{key:"DATA_API_KEY",get:function(){return a}},{key:"DatePickerModes",get:function(){return d}},{key:"ViewModes",get:function(){return u}},{key:"MinViewModeNumber",get:function(){return _}},{key:"Event",get:function(){return h}},{key:"Selector",get:function(){return r}},{key:"Default",get:function(){return m},set:function(t){m=t}},{key:"ClassName",get:function(){return p}}]),n}()}(jQuery,moment); | ||
var _createClass=function(){function o(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t}}();function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var DateTimePicker=function(s,i){var t="datetimepicker",e=""+t,o="."+e,a=".data-api",r={DATA_TOGGLE:'[data-toggle="'+e+'"]'},p={INPUT:t+"-input"},h={CHANGE:"change"+o,BLUR:"blur"+o,KEYUP:"keyup"+o,KEYDOWN:"keydown"+o,FOCUS:"focus"+o,CLICK_DATA_API:"click"+o+a,UPDATE:"update"+o,ERROR:"error"+o,HIDE:"hide"+o,SHOW:"show"+o},d=[{CLASS_NAME:"days",NAV_FUNCTION:"M",NAV_STEP:1},{CLASS_NAME:"months",NAV_FUNCTION:"y",NAV_STEP:1},{CLASS_NAME:"years",NAV_FUNCTION:"y",NAV_STEP:10},{CLASS_NAME:"decades",NAV_FUNCTION:"y",NAV_STEP:100}],l={up:38,38:"up",down:40,40:"down",left:37,37:"left",right:39,39:"right",tab:9,9:"tab",escape:27,27:"escape",enter:13,13:"enter",pageUp:33,33:"pageUp",pageDown:34,34:"pageDown",shift:16,16:"shift",control:17,17:"control",space:32,32:"space",t:84,84:"t",delete:46,46:"delete"},u=["times","days","months","years","decades"],f={},c={},_={timeZone:"",format:!1,dayViewHeaderFormat:"MMMM YYYY",extraFormats:!1,stepping:1,minDate:!1,maxDate:!1,useCurrent:!0,collapse:!0,locale:i.locale(),defaultDate:!1,disabledDates:!1,enabledDates:!1,icons:{time:"fa fa-clock-o",date:"fa fa-calendar",up:"fa fa-arrow-up",down:"fa fa-arrow-down",previous:"fa fa-chevron-left",next:"fa fa-chevron-right",today:"fa fa-calendar-check-o",clear:"fa fa-delete",close:"fa fa-times"},tooltips:{today:"Go to today",clear:"Clear selection",close:"Close the picker",selectMonth:"Select Month",prevMonth:"Previous Month",nextMonth:"Next Month",selectYear:"Select Year",prevYear:"Previous Year",nextYear:"Next Year",selectDecade:"Select Decade",prevDecade:"Previous Decade",nextDecade:"Next Decade",prevCentury:"Previous Century",nextCentury:"Next Century",pickHour:"Pick Hour",incrementHour:"Increment Hour",decrementHour:"Decrement Hour",pickMinute:"Pick Minute",incrementMinute:"Increment Minute",decrementMinute:"Decrement Minute",pickSecond:"Pick Second",incrementSecond:"Increment Second",decrementSecond:"Decrement Second",togglePeriod:"Toggle Period",selectTime:"Select Time",selectDate:"Select Date"},useStrict:!1,sideBySide:!1,daysOfWeekDisabled:!1,calendarWeeks:!1,viewMode:"days",toolbarPlacement:"default",buttons:{showToday:!1,showClear:!1,showClose:!1},widgetPositioning:{horizontal:"auto",vertical:"auto"},widgetParent:null,ignoreReadonly:!1,keepOpen:!1,focusOnShow:!0,inline:!1,keepInvalid:!1,keyBinds:{up:function(){if(!this.widget)return!1;var t=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")?this.date(t.clone().subtract(7,"d")):this.date(t.clone().add(this.stepping(),"m")),!0},down:function(){if(!this.widget)return this.show(),!1;var t=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")?this.date(t.clone().add(7,"d")):this.date(t.clone().subtract(this.stepping(),"m")),!0},"control up":function(){if(!this.widget)return!1;var t=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")?this.date(t.clone().subtract(1,"y")):this.date(t.clone().add(1,"h")),!0},"control down":function(){if(!this.widget)return!1;var t=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")?this.date(t.clone().add(1,"y")):this.date(t.clone().subtract(1,"h")),!0},left:function(){if(!this.widget)return!1;var t=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")&&this.date(t.clone().subtract(1,"d")),!0},right:function(){if(!this.widget)return!1;var t=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")&&this.date(t.clone().add(1,"d")),!0},pageUp:function(){if(!this.widget)return!1;var t=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")&&this.date(t.clone().subtract(1,"M")),!0},pageDown:function(){if(!this.widget)return!1;var t=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")&&this.date(t.clone().add(1,"M")),!0},enter:function(){return!!this.widget&&(this.hide(),!0)},escape:function(){return!!this.widget&&(this.hide(),!0)},"control space":function(){return!!this.widget&&(this.widget.find(".timepicker").is(":visible")&&this.widget.find('.btn[data-action="togglePeriod"]').click(),!0)},t:function(){return!!this.widget&&(this.date(this.getMoment()),!0)},delete:function(){return!!this.widget&&(this.clear(),!0)}},debug:!1,allowInputToggle:!1,disabledTimeIntervals:!1,disabledHours:!1,enabledHours:!1,viewDate:!1,allowMultidate:!1,multidateSeparator:","};return function(){function n(t,e){_classCallCheck(this,n),this._options=this._getOptions(e),this._element=t,this._dates=[],this._datesFormatted=[],this._viewDate=null,this.unset=!0,this.component=!1,this.widget=!1,this.use24Hours=null,this.actualFormat=null,this.parseFormats=null,this.currentViewMode=null,this.MinViewModeNumber=0,this._int()}return n.prototype._int=function(){var t=this._element.data("target-input");this._element.is("input")?this.input=this._element:void 0!==t&&(this.input="nearest"===t?this._element.find("input"):s(t)),this._dates=[],this._dates[0]=this.getMoment(),this._viewDate=this.getMoment().clone(),s.extend(!0,this._options,this._dataToOptions()),this.options(this._options),this._initFormatting(),void 0!==this.input&&this.input.is("input")&&0!==this.input.val().trim().length?this._setValue(this._parseInputDate(this.input.val().trim()),0):this._options.defaultDate&&void 0!==this.input&&void 0===this.input.attr("placeholder")&&this._setValue(this._options.defaultDate,0),this._options.inline&&this.show()},n.prototype._update=function(){this.widget&&(this._fillDate(),this._fillTime())},n.prototype._setValue=function(t,e){var i=this.unset?null:this._dates[e],o="";if(!t)return this._options.allowMultidate&&1!==this._dates.length?(o=(o=this._element.data("date")+",").replace(i.format(this.actualFormat)+",","").replace(",,","").replace(/,\s*$/,""),this._dates.splice(e,1),this._datesFormatted.splice(e,1)):(this.unset=!0,this._dates=[],this._datesFormatted=[]),void 0!==this.input&&(this.input.val(o),this.input.trigger("input")),this._element.data("date",o),this._notifyEvent({type:n.Event.CHANGE,date:!1,oldDate:i}),void this._update();if(t=t.clone().locale(this._options.locale),this._hasTimeZone()&&t.tz(this._options.timeZone),1!==this._options.stepping&&t.minutes(Math.round(t.minutes()/this._options.stepping)*this._options.stepping).seconds(0),this._isValid(t)){if(this._dates[e]=t,this._datesFormatted[e]=t.format("YYYY-MM-DD"),this._viewDate=t.clone(),this._options.allowMultidate&&1<this._dates.length){for(var s=0;s<this._dates.length;s++)o+=""+this._dates[s].format(this.actualFormat)+this._options.multidateSeparator;o=o.replace(/,\s*$/,"")}else o=this._dates[e].format(this.actualFormat);void 0!==this.input&&(this.input.val(o),this.input.trigger("input")),this._element.data("date",o),this.unset=!1,this._update(),this._notifyEvent({type:n.Event.CHANGE,date:this._dates[e].clone(),oldDate:i})}else this._options.keepInvalid?this._notifyEvent({type:n.Event.CHANGE,date:t,oldDate:i}):void 0!==this.input&&(this.input.val(""+(this.unset?"":this._dates[e].format(this.actualFormat))),this.input.trigger("input")),this._notifyEvent({type:n.Event.ERROR,date:t,oldDate:i})},n.prototype._change=function(t){var e=s(t.target).val().trim(),i=e?this._parseInputDate(e):null;return this._setValue(i),t.stopImmediatePropagation(),!1},n.prototype._getOptions=function(t){return t=s.extend(!0,{},_,t)},n.prototype._hasTimeZone=function(){return void 0!==i.tz&&void 0!==this._options.timeZone&&null!==this._options.timeZone&&""!==this._options.timeZone},n.prototype._isEnabled=function(t){if("string"!=typeof t||1<t.length)throw new TypeError("isEnabled expects a single character string parameter");switch(t){case"y":return-1!==this.actualFormat.indexOf("Y");case"M":return-1!==this.actualFormat.indexOf("M");case"d":return-1!==this.actualFormat.toLowerCase().indexOf("d");case"h":case"H":return-1!==this.actualFormat.toLowerCase().indexOf("h");case"m":return-1!==this.actualFormat.indexOf("m");case"s":return-1!==this.actualFormat.indexOf("s");case"a":case"A":return-1!==this.actualFormat.toLowerCase().indexOf("a");default:return!1}},n.prototype._hasTime=function(){return this._isEnabled("h")||this._isEnabled("m")||this._isEnabled("s")},n.prototype._hasDate=function(){return this._isEnabled("y")||this._isEnabled("M")||this._isEnabled("d")},n.prototype._dataToOptions=function(){var i=this._element.data(),o={};return i.dateOptions&&i.dateOptions instanceof Object&&(o=s.extend(!0,o,i.dateOptions)),s.each(this._options,function(t){var e="date"+t.charAt(0).toUpperCase()+t.slice(1);void 0!==i[e]?o[t]=i[e]:delete o[t]}),o},n.prototype._notifyEvent=function(t){t.type===n.Event.CHANGE&&t.date&&t.date.isSame(t.oldDate)||!t.date&&!t.oldDate||this._element.trigger(t)},n.prototype._viewUpdate=function(t){"y"===t&&(t="YYYY"),this._notifyEvent({type:n.Event.UPDATE,change:t,viewDate:this._viewDate.clone()})},n.prototype._showMode=function(t){this.widget&&(t&&(this.currentViewMode=Math.max(this.MinViewModeNumber,Math.min(3,this.currentViewMode+t))),this.widget.find(".datepicker > div").hide().filter(".datepicker-"+d[this.currentViewMode].CLASS_NAME).show())},n.prototype._isInDisabledDates=function(t){return!0===this._options.disabledDates[t.format("YYYY-MM-DD")]},n.prototype._isInEnabledDates=function(t){return!0===this._options.enabledDates[t.format("YYYY-MM-DD")]},n.prototype._isInDisabledHours=function(t){return!0===this._options.disabledHours[t.format("H")]},n.prototype._isInEnabledHours=function(t){return!0===this._options.enabledHours[t.format("H")]},n.prototype._isValid=function(t,e){if(!t.isValid())return!1;if(this._options.disabledDates&&"d"===e&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===e&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,e))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,e))return!1;if(this._options.daysOfWeekDisabled&&"d"===e&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===e||"m"===e||"s"===e)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===e||"m"===e||"s"===e)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===e||"m"===e||"s"===e)){var i=!1;if(s.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(i=!0)}),i)return!1}return!0},n.prototype._parseInputDate=function(t){return void 0===this._options.parseInputDate?i.isMoment(t)||(t=this.getMoment(t)):t=this._options.parseInputDate(t),t},n.prototype._keydown=function(t){var e=null,i=void 0,o=void 0,s=void 0,n=void 0,a=[],r={},p=t.which;for(i in f[p]="p",f)f.hasOwnProperty(i)&&"p"===f[i]&&(a.push(i),parseInt(i,10)!==p&&(r[i]=!0));for(i in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(i)&&"function"==typeof this._options.keyBinds[i]&&(s=i.split(" ")).length===a.length&&l[p]===s[s.length-1]){for(n=!0,o=s.length-2;0<=o;o--)if(!(l[s[o]]in r)){n=!1;break}if(n){e=this._options.keyBinds[i];break}}e&&e.call(this)&&(t.stopPropagation(),t.preventDefault())},n.prototype._keyup=function(t){f[t.which]="r",c[t.which]&&(c[t.which]=!1,t.stopPropagation(),t.preventDefault())},n.prototype._indexGivenDates=function(t){var e={},i=this;return s.each(t,function(){var t=i._parseInputDate(this);t.isValid()&&(e[t.format("YYYY-MM-DD")]=!0)}),!!Object.keys(e).length&&e},n.prototype._indexGivenHours=function(t){var e={};return s.each(t,function(){e[this]=!0}),!!Object.keys(e).length&&e},n.prototype._initFormatting=function(){var t=this._options.format||"L LT",e=this;this.actualFormat=t.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(t){return e._dates[0].localeData().longDateFormat(t)||t}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(t)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},n.prototype._getLastPickedDate=function(){return this._dates[this._getLastPickedDateIndex()]},n.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},n.prototype.getMoment=function(t){var e=void 0;return e=null==t?i():this._hasTimeZone()?i.tz(t,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):i(t,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&e.tz(this._options.timeZone),e},n.prototype.toggle=function(){return this.widget?this.hide():this.show()},n.prototype.ignoreReadonly=function(t){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof t)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=t},n.prototype.options=function(t){if(0===arguments.length)return s.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");s.extend(!0,this._options,t);var i=this;s.each(this._options,function(t,e){void 0!==i[t]&&i[t](e)})},n.prototype.date=function(t,e){if(e=e||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[e].clone();if(!(null===t||"string"==typeof t||i.isMoment(t)||t instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");this._setValue(null===t?null:this._parseInputDate(t),e)},n.prototype.format=function(t){if(0===arguments.length)return this._options.format;if("string"!=typeof t&&("boolean"!=typeof t||!1!==t))throw new TypeError("format() expects a string or boolean:false parameter "+t);this._options.format=t,this.actualFormat&&this._initFormatting()},n.prototype.timeZone=function(t){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof t)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=t},n.prototype.dayViewHeaderFormat=function(t){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof t)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=t},n.prototype.extraFormats=function(t){if(0===arguments.length)return this._options.extraFormats;if(!1!==t&&!(t instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=t,this.parseFormats&&this._initFormatting()},n.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?s.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},n.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?s.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},n.prototype.daysOfWeekDisabled=function(t){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof t&&!t)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=t.reduce(function(t,e){return 6<(e=parseInt(e,10))||e<0||isNaN(e)||-1===t.indexOf(e)&&t.push(e),t},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e<this._dates.length;e++){for(var i=0;!this._isValid(this._dates[e],"d");){if(this._dates[e].add(1,"d"),31===i)throw"Tried 31 times to find a valid date";i++}this._setValue(this._dates[e],e)}this._update()},n.prototype.maxDate=function(t){if(0===arguments.length)return this._options.maxDate?this._options.maxDate.clone():this._options.maxDate;if("boolean"==typeof t&&!1===t)return this._options.maxDate=!1,this._update(),!0;"string"==typeof t&&("now"!==t&&"moment"!==t||(t=this.getMoment()));var e=this._parseInputDate(t);if(!e.isValid())throw new TypeError("maxDate() Could not parse date parameter: "+t);if(this._options.minDate&&e.isBefore(this._options.minDate))throw new TypeError("maxDate() date parameter is before this.options.minDate: "+e.format(this.actualFormat));this._options.maxDate=e;for(var i=0;i<this._dates.length;i++)this._options.useCurrent&&!this._options.keepInvalid&&this._dates[i].isAfter(t)&&this._setValue(this._options.maxDate,i);this._viewDate.isAfter(e)&&(this._viewDate=e.clone().subtract(this._options.stepping,"m")),this._update()},n.prototype.minDate=function(t){if(0===arguments.length)return this._options.minDate?this._options.minDate.clone():this._options.minDate;if("boolean"==typeof t&&!1===t)return this._options.minDate=!1,this._update(),!0;"string"==typeof t&&("now"!==t&&"moment"!==t||(t=this.getMoment()));var e=this._parseInputDate(t);if(!e.isValid())throw new TypeError("minDate() Could not parse date parameter: "+t);if(this._options.maxDate&&e.isAfter(this._options.maxDate))throw new TypeError("minDate() date parameter is after this.options.maxDate: "+e.format(this.actualFormat));this._options.minDate=e;for(var i=0;i<this._dates.length;i++)this._options.useCurrent&&!this._options.keepInvalid&&this._dates[i].isBefore(t)&&this._setValue(this._options.minDate,i);this._viewDate.isBefore(e)&&(this._viewDate=e.clone().add(this._options.stepping,"m")),this._update()},n.prototype.defaultDate=function(t){if(0===arguments.length)return this._options.defaultDate?this._options.defaultDate.clone():this._options.defaultDate;if(!t)return!(this._options.defaultDate=!1);"string"==typeof t&&(t="now"===t||"moment"===t?this.getMoment():this.getMoment(t));var e=this._parseInputDate(t);if(!e.isValid())throw new TypeError("defaultDate() Could not parse date parameter: "+t);if(!this._isValid(e))throw new TypeError("defaultDate() date passed is invalid according to component setup validations");this._options.defaultDate=e,(this._options.defaultDate&&this._options.inline||void 0!==this.input&&""===this.input.val().trim())&&this._setValue(this._options.defaultDate,0)},n.prototype.locale=function(t){if(0===arguments.length)return this._options.locale;if(!i.localeData(t))throw new TypeError("locale() locale "+t+" is not loaded from moment locales!");this._options.locale=t;for(var e=0;e<this._dates.length;e++)this._dates[e].locale(this._options.locale);this._viewDate.locale(this._options.locale),this.actualFormat&&this._initFormatting(),this.widget&&(this.hide(),this.show())},n.prototype.stepping=function(t){if(0===arguments.length)return this._options.stepping;t=parseInt(t,10),(isNaN(t)||t<1)&&(t=1),this._options.stepping=t},n.prototype.useCurrent=function(t){var e=["year","month","day","hour","minute"];if(0===arguments.length)return this._options.useCurrent;if("boolean"!=typeof t&&"string"!=typeof t)throw new TypeError("useCurrent() expects a boolean or string parameter");if("string"==typeof t&&-1===e.indexOf(t.toLowerCase()))throw new TypeError("useCurrent() expects a string parameter of "+e.join(", "));this._options.useCurrent=t},n.prototype.collapse=function(t){if(0===arguments.length)return this._options.collapse;if("boolean"!=typeof t)throw new TypeError("collapse() expects a boolean parameter");if(this._options.collapse===t)return!0;this._options.collapse=t,this.widget&&(this.hide(),this.show())},n.prototype.icons=function(t){if(0===arguments.length)return s.extend({},this._options.icons);if(!(t instanceof Object))throw new TypeError("icons() expects parameter to be an Object");s.extend(this._options.icons,t),this.widget&&(this.hide(),this.show())},n.prototype.tooltips=function(t){if(0===arguments.length)return s.extend({},this._options.tooltips);if(!(t instanceof Object))throw new TypeError("tooltips() expects parameter to be an Object");s.extend(this._options.tooltips,t),this.widget&&(this.hide(),this.show())},n.prototype.useStrict=function(t){if(0===arguments.length)return this._options.useStrict;if("boolean"!=typeof t)throw new TypeError("useStrict() expects a boolean parameter");this._options.useStrict=t},n.prototype.sideBySide=function(t){if(0===arguments.length)return this._options.sideBySide;if("boolean"!=typeof t)throw new TypeError("sideBySide() expects a boolean parameter");this._options.sideBySide=t,this.widget&&(this.hide(),this.show())},n.prototype.viewMode=function(t){if(0===arguments.length)return this._options.viewMode;if("string"!=typeof t)throw new TypeError("viewMode() expects a string parameter");if(-1===n.ViewModes.indexOf(t))throw new TypeError("viewMode() parameter must be one of ("+n.ViewModes.join(", ")+") value");this._options.viewMode=t,this.currentViewMode=Math.max(n.ViewModes.indexOf(t)-1,this.MinViewModeNumber),this._showMode()},n.prototype.calendarWeeks=function(t){if(0===arguments.length)return this._options.calendarWeeks;if("boolean"!=typeof t)throw new TypeError("calendarWeeks() expects parameter to be a boolean value");this._options.calendarWeeks=t,this._update()},n.prototype.buttons=function(t){if(0===arguments.length)return s.extend({},this._options.buttons);if(!(t instanceof Object))throw new TypeError("buttons() expects parameter to be an Object");if(s.extend(this._options.buttons,t),"boolean"!=typeof this._options.buttons.showToday)throw new TypeError("buttons.showToday expects a boolean parameter");if("boolean"!=typeof this._options.buttons.showClear)throw new TypeError("buttons.showClear expects a boolean parameter");if("boolean"!=typeof this._options.buttons.showClose)throw new TypeError("buttons.showClose expects a boolean parameter");this.widget&&(this.hide(),this.show())},n.prototype.keepOpen=function(t){if(0===arguments.length)return this._options.keepOpen;if("boolean"!=typeof t)throw new TypeError("keepOpen() expects a boolean parameter");this._options.keepOpen=t},n.prototype.focusOnShow=function(t){if(0===arguments.length)return this._options.focusOnShow;if("boolean"!=typeof t)throw new TypeError("focusOnShow() expects a boolean parameter");this._options.focusOnShow=t},n.prototype.inline=function(t){if(0===arguments.length)return this._options.inline;if("boolean"!=typeof t)throw new TypeError("inline() expects a boolean parameter");this._options.inline=t},n.prototype.clear=function(){this._setValue(null)},n.prototype.keyBinds=function(t){if(0===arguments.length)return this._options.keyBinds;this._options.keyBinds=t},n.prototype.debug=function(t){if("boolean"!=typeof t)throw new TypeError("debug() expects a boolean parameter");this._options.debug=t},n.prototype.allowInputToggle=function(t){if(0===arguments.length)return this._options.allowInputToggle;if("boolean"!=typeof t)throw new TypeError("allowInputToggle() expects a boolean parameter");this._options.allowInputToggle=t},n.prototype.keepInvalid=function(t){if(0===arguments.length)return this._options.keepInvalid;if("boolean"!=typeof t)throw new TypeError("keepInvalid() expects a boolean parameter");this._options.keepInvalid=t},n.prototype.datepickerInput=function(t){if(0===arguments.length)return this._options.datepickerInput;if("string"!=typeof t)throw new TypeError("datepickerInput() expects a string parameter");this._options.datepickerInput=t},n.prototype.parseInputDate=function(t){if(0===arguments.length)return this._options.parseInputDate;if("function"!=typeof t)throw new TypeError("parseInputDate() should be as function");this._options.parseInputDate=t},n.prototype.disabledTimeIntervals=function(t){if(0===arguments.length)return this._options.disabledTimeIntervals?s.extend({},this._options.disabledTimeIntervals):this._options.disabledTimeIntervals;if(!t)return this._options.disabledTimeIntervals=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledTimeIntervals() expects an array parameter");this._options.disabledTimeIntervals=t,this._update()},n.prototype.disabledHours=function(t){if(0===arguments.length)return this._options.disabledHours?s.extend({},this._options.disabledHours):this._options.disabledHours;if(!t)return this._options.disabledHours=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledHours() expects an array parameter");if(this._options.disabledHours=this._indexGivenHours(t),this._options.enabledHours=!1,this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e<this._dates.length;e++){for(var i=0;!this._isValid(this._dates[e],"h");){if(this._dates[e].add(1,"h"),24===i)throw"Tried 24 times to find a valid date";i++}this._setValue(this._dates[e],e)}this._update()},n.prototype.enabledHours=function(t){if(0===arguments.length)return this._options.enabledHours?s.extend({},this._options.enabledHours):this._options.enabledHours;if(!t)return this._options.enabledHours=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledHours() expects an array parameter");if(this._options.enabledHours=this._indexGivenHours(t),this._options.disabledHours=!1,this._options.useCurrent&&!this._options.keepInvalid)for(var e=0;e<this._dates.length;e++){for(var i=0;!this._isValid(this._dates[e],"h");){if(this._dates[e].add(1,"h"),24===i)throw"Tried 24 times to find a valid date";i++}this._setValue(this._dates[e],e)}this._update()},n.prototype.viewDate=function(t){if(0===arguments.length)return this._viewDate.clone();if(!t)return this._viewDate=(this._dates[0]||this.getMoment()).clone(),!0;if(!("string"==typeof t||i.isMoment(t)||t instanceof Date))throw new TypeError("viewDate() parameter must be one of [string, moment or Date]");this._viewDate=this._parseInputDate(t),this._viewUpdate()},n.prototype.allowMultidate=function(t){if("boolean"!=typeof t)throw new TypeError("allowMultidate() expects a boolean parameter");this._options.allowMultidate=t},n.prototype.multidateSeparator=function(t){if(0===arguments.length)return this._options.multidateSeparator;if("string"!=typeof t||1<t.length)throw new TypeError("multidateSeparator expects a single character string parameter");this._options.multidateSeparator=t},_createClass(n,null,[{key:"NAME",get:function(){return t}},{key:"DATA_KEY",get:function(){return e}},{key:"EVENT_KEY",get:function(){return o}},{key:"DATA_API_KEY",get:function(){return a}},{key:"DatePickerModes",get:function(){return d}},{key:"ViewModes",get:function(){return u}},{key:"Event",get:function(){return h}},{key:"Selector",get:function(){return r}},{key:"Default",get:function(){return _},set:function(t){_=t}},{key:"ClassName",get:function(){return p}}]),n}()}(jQuery,moment); |
@@ -30,3 +30,3 @@ { | ||
"grunt-contrib-connect": "^1.0.1", | ||
"grunt-contrib-jasmine": "^2.0.1", | ||
"grunt-contrib-jasmine": "^2.0.2", | ||
"grunt-contrib-jshint": "latest", | ||
@@ -53,3 +53,3 @@ "grunt-contrib-less": "latest", | ||
}, | ||
"version": "5.0.0", | ||
"version": "5.0.2", | ||
"files": [ | ||
@@ -56,0 +56,0 @@ "build", |
@@ -81,214 +81,213 @@ import jQuery from 'jquery'; | ||
let MinViewModeNumber = 0, | ||
Default = { | ||
timeZone: '', | ||
format: false, | ||
dayViewHeaderFormat: 'MMMM YYYY', | ||
extraFormats: false, | ||
stepping: 1, | ||
minDate: false, | ||
maxDate: false, | ||
useCurrent: true, | ||
collapse: true, | ||
locale: moment.locale(), | ||
defaultDate: false, | ||
disabledDates: false, | ||
enabledDates: false, | ||
icons: { | ||
time: 'fa fa-clock-o', | ||
date: 'fa fa-calendar', | ||
up: 'fa fa-arrow-up', | ||
down: 'fa fa-arrow-down', | ||
previous: 'fa fa-chevron-left', | ||
next: 'fa fa-chevron-right', | ||
today: 'fa fa-calendar-check-o', | ||
clear: 'fa fa-delete', | ||
close: 'fa fa-times' | ||
let Default = { | ||
timeZone: '', | ||
format: false, | ||
dayViewHeaderFormat: 'MMMM YYYY', | ||
extraFormats: false, | ||
stepping: 1, | ||
minDate: false, | ||
maxDate: false, | ||
useCurrent: true, | ||
collapse: true, | ||
locale: moment.locale(), | ||
defaultDate: false, | ||
disabledDates: false, | ||
enabledDates: false, | ||
icons: { | ||
time: 'fa fa-clock-o', | ||
date: 'fa fa-calendar', | ||
up: 'fa fa-arrow-up', | ||
down: 'fa fa-arrow-down', | ||
previous: 'fa fa-chevron-left', | ||
next: 'fa fa-chevron-right', | ||
today: 'fa fa-calendar-check-o', | ||
clear: 'fa fa-delete', | ||
close: 'fa fa-times' | ||
}, | ||
tooltips: { | ||
today: 'Go to today', | ||
clear: 'Clear selection', | ||
close: 'Close the picker', | ||
selectMonth: 'Select Month', | ||
prevMonth: 'Previous Month', | ||
nextMonth: 'Next Month', | ||
selectYear: 'Select Year', | ||
prevYear: 'Previous Year', | ||
nextYear: 'Next Year', | ||
selectDecade: 'Select Decade', | ||
prevDecade: 'Previous Decade', | ||
nextDecade: 'Next Decade', | ||
prevCentury: 'Previous Century', | ||
nextCentury: 'Next Century', | ||
pickHour: 'Pick Hour', | ||
incrementHour: 'Increment Hour', | ||
decrementHour: 'Decrement Hour', | ||
pickMinute: 'Pick Minute', | ||
incrementMinute: 'Increment Minute', | ||
decrementMinute: 'Decrement Minute', | ||
pickSecond: 'Pick Second', | ||
incrementSecond: 'Increment Second', | ||
decrementSecond: 'Decrement Second', | ||
togglePeriod: 'Toggle Period', | ||
selectTime: 'Select Time', | ||
selectDate: 'Select Date' | ||
}, | ||
useStrict: false, | ||
sideBySide: false, | ||
daysOfWeekDisabled: false, | ||
calendarWeeks: false, | ||
viewMode: 'days', | ||
toolbarPlacement: 'default', | ||
buttons: { | ||
showToday: false, | ||
showClear: false, | ||
showClose: false | ||
}, | ||
widgetPositioning: { | ||
horizontal: 'auto', | ||
vertical: 'auto' | ||
}, | ||
widgetParent: null, | ||
ignoreReadonly: false, | ||
keepOpen: false, | ||
focusOnShow: true, | ||
inline: false, | ||
keepInvalid: false, | ||
keyBinds: { | ||
up: function () { | ||
if (!this.widget) { | ||
return false; | ||
} | ||
const d = this._dates[0] || this.getMoment(); | ||
if (this.widget.find('.datepicker').is(':visible')) { | ||
this.date(d.clone().subtract(7, 'd')); | ||
} else { | ||
this.date(d.clone().add(this.stepping(), 'm')); | ||
} | ||
return true; | ||
}, | ||
tooltips: { | ||
today: 'Go to today', | ||
clear: 'Clear selection', | ||
close: 'Close the picker', | ||
selectMonth: 'Select Month', | ||
prevMonth: 'Previous Month', | ||
nextMonth: 'Next Month', | ||
selectYear: 'Select Year', | ||
prevYear: 'Previous Year', | ||
nextYear: 'Next Year', | ||
selectDecade: 'Select Decade', | ||
prevDecade: 'Previous Decade', | ||
nextDecade: 'Next Decade', | ||
prevCentury: 'Previous Century', | ||
nextCentury: 'Next Century', | ||
pickHour: 'Pick Hour', | ||
incrementHour: 'Increment Hour', | ||
decrementHour: 'Decrement Hour', | ||
pickMinute: 'Pick Minute', | ||
incrementMinute: 'Increment Minute', | ||
decrementMinute: 'Decrement Minute', | ||
pickSecond: 'Pick Second', | ||
incrementSecond: 'Increment Second', | ||
decrementSecond: 'Decrement Second', | ||
togglePeriod: 'Toggle Period', | ||
selectTime: 'Select Time', | ||
selectDate: 'Select Date' | ||
down: function () { | ||
if (!this.widget) { | ||
this.show(); | ||
return false; | ||
} | ||
const d = this._dates[0] || this.getMoment(); | ||
if (this.widget.find('.datepicker').is(':visible')) { | ||
this.date(d.clone().add(7, 'd')); | ||
} else { | ||
this.date(d.clone().subtract(this.stepping(), 'm')); | ||
} | ||
return true; | ||
}, | ||
useStrict: false, | ||
sideBySide: false, | ||
daysOfWeekDisabled: false, | ||
calendarWeeks: false, | ||
viewMode: 'days', | ||
toolbarPlacement: 'default', | ||
buttons: { | ||
showToday: false, | ||
showClear: false, | ||
showClose: false | ||
'control up': function () { | ||
if (!this.widget) { | ||
return false; | ||
} | ||
const d = this._dates[0] || this.getMoment(); | ||
if (this.widget.find('.datepicker').is(':visible')) { | ||
this.date(d.clone().subtract(1, 'y')); | ||
} else { | ||
this.date(d.clone().add(1, 'h')); | ||
} | ||
return true; | ||
}, | ||
widgetPositioning: { | ||
horizontal: 'auto', | ||
vertical: 'auto' | ||
'control down': function () { | ||
if (!this.widget) { | ||
return false; | ||
} | ||
const d = this._dates[0] || this.getMoment(); | ||
if (this.widget.find('.datepicker').is(':visible')) { | ||
this.date(d.clone().add(1, 'y')); | ||
} else { | ||
this.date(d.clone().subtract(1, 'h')); | ||
} | ||
return true; | ||
}, | ||
widgetParent: null, | ||
ignoreReadonly: false, | ||
keepOpen: false, | ||
focusOnShow: true, | ||
inline: false, | ||
keepInvalid: false, | ||
keyBinds: { | ||
up: function () { | ||
if (!this.widget) { | ||
return false; | ||
} | ||
const d = this._dates[0] || this.getMoment(); | ||
if (this.widget.find('.datepicker').is(':visible')) { | ||
this.date(d.clone().subtract(7, 'd')); | ||
} else { | ||
this.date(d.clone().add(this.stepping(), 'm')); | ||
} | ||
return true; | ||
}, | ||
down: function () { | ||
if (!this.widget) { | ||
this.show(); | ||
return false; | ||
} | ||
const d = this._dates[0] || this.getMoment(); | ||
if (this.widget.find('.datepicker').is(':visible')) { | ||
this.date(d.clone().add(7, 'd')); | ||
} else { | ||
this.date(d.clone().subtract(this.stepping(), 'm')); | ||
} | ||
return true; | ||
}, | ||
'control up': function () { | ||
if (!this.widget) { | ||
return false; | ||
} | ||
const d = this._dates[0] || this.getMoment(); | ||
if (this.widget.find('.datepicker').is(':visible')) { | ||
this.date(d.clone().subtract(1, 'y')); | ||
} else { | ||
this.date(d.clone().add(1, 'h')); | ||
} | ||
return true; | ||
}, | ||
'control down': function () { | ||
if (!this.widget) { | ||
return false; | ||
} | ||
const d = this._dates[0] || this.getMoment(); | ||
if (this.widget.find('.datepicker').is(':visible')) { | ||
this.date(d.clone().add(1, 'y')); | ||
} else { | ||
this.date(d.clone().subtract(1, 'h')); | ||
} | ||
return true; | ||
}, | ||
left: function () { | ||
if (!this.widget) { | ||
return false; | ||
} | ||
const d = this._dates[0] || this.getMoment(); | ||
if (this.widget.find('.datepicker').is(':visible')) { | ||
this.date(d.clone().subtract(1, 'd')); | ||
} | ||
return true; | ||
}, | ||
right: function () { | ||
if (!this.widget) { | ||
return false; | ||
} | ||
const d = this._dates[0] || this.getMoment(); | ||
if (this.widget.find('.datepicker').is(':visible')) { | ||
this.date(d.clone().add(1, 'd')); | ||
} | ||
return true; | ||
}, | ||
pageUp: function () { | ||
if (!this.widget) { | ||
return false; | ||
} | ||
const d = this._dates[0] || this.getMoment(); | ||
if (this.widget.find('.datepicker').is(':visible')) { | ||
this.date(d.clone().subtract(1, 'M')); | ||
} | ||
return true; | ||
}, | ||
pageDown: function () { | ||
if (!this.widget) { | ||
return false; | ||
} | ||
const d = this._dates[0] || this.getMoment(); | ||
if (this.widget.find('.datepicker').is(':visible')) { | ||
this.date(d.clone().add(1, 'M')); | ||
} | ||
return true; | ||
}, | ||
enter: function () { | ||
if (!this.widget) { | ||
return false; | ||
} | ||
this.hide(); | ||
return true; | ||
}, | ||
escape: function () { | ||
if (!this.widget) { | ||
return false; | ||
} | ||
this.hide(); | ||
return true; | ||
}, | ||
'control space': function () { | ||
if (!this.widget) { | ||
return false; | ||
} | ||
if (this.widget.find('.timepicker').is(':visible')) { | ||
this.widget.find('.btn[data-action="togglePeriod"]').click(); | ||
} | ||
return true; | ||
}, | ||
t: function () { | ||
if (!this.widget) { | ||
return false; | ||
} | ||
this.date(this.getMoment()); | ||
return true; | ||
}, | ||
'delete': function () { | ||
if (!this.widget) { | ||
return false; | ||
} | ||
this.clear(); | ||
return true; | ||
left: function () { | ||
if (!this.widget) { | ||
return false; | ||
} | ||
const d = this._dates[0] || this.getMoment(); | ||
if (this.widget.find('.datepicker').is(':visible')) { | ||
this.date(d.clone().subtract(1, 'd')); | ||
} | ||
return true; | ||
}, | ||
debug: false, | ||
allowInputToggle: false, | ||
disabledTimeIntervals: false, | ||
disabledHours: false, | ||
enabledHours: false, | ||
viewDate: false, | ||
allowMultidate: false, | ||
multidateSeparator: ',' | ||
}; | ||
right: function () { | ||
if (!this.widget) { | ||
return false; | ||
} | ||
const d = this._dates[0] || this.getMoment(); | ||
if (this.widget.find('.datepicker').is(':visible')) { | ||
this.date(d.clone().add(1, 'd')); | ||
} | ||
return true; | ||
}, | ||
pageUp: function () { | ||
if (!this.widget) { | ||
return false; | ||
} | ||
const d = this._dates[0] || this.getMoment(); | ||
if (this.widget.find('.datepicker').is(':visible')) { | ||
this.date(d.clone().subtract(1, 'M')); | ||
} | ||
return true; | ||
}, | ||
pageDown: function () { | ||
if (!this.widget) { | ||
return false; | ||
} | ||
const d = this._dates[0] || this.getMoment(); | ||
if (this.widget.find('.datepicker').is(':visible')) { | ||
this.date(d.clone().add(1, 'M')); | ||
} | ||
return true; | ||
}, | ||
enter: function () { | ||
if (!this.widget) { | ||
return false; | ||
} | ||
this.hide(); | ||
return true; | ||
}, | ||
escape: function () { | ||
if (!this.widget) { | ||
return false; | ||
} | ||
this.hide(); | ||
return true; | ||
}, | ||
'control space': function () { | ||
if (!this.widget) { | ||
return false; | ||
} | ||
if (this.widget.find('.timepicker').is(':visible')) { | ||
this.widget.find('.btn[data-action="togglePeriod"]').click(); | ||
} | ||
return true; | ||
}, | ||
t: function () { | ||
if (!this.widget) { | ||
return false; | ||
} | ||
this.date(this.getMoment()); | ||
return true; | ||
}, | ||
'delete': function () { | ||
if (!this.widget) { | ||
return false; | ||
} | ||
this.clear(); | ||
return true; | ||
} | ||
}, | ||
debug: false, | ||
allowInputToggle: false, | ||
disabledTimeIntervals: false, | ||
disabledHours: false, | ||
enabledHours: false, | ||
viewDate: false, | ||
allowMultidate: false, | ||
multidateSeparator: ',' | ||
}; | ||
@@ -316,2 +315,3 @@ // ReSharper restore InconsistentNaming | ||
this.currentViewMode = null; | ||
this.MinViewModeNumber = 0; | ||
@@ -357,9 +357,2 @@ this._int(); | ||
/** | ||
* @return {number} | ||
*/ | ||
static get MinViewModeNumber() { | ||
return MinViewModeNumber; | ||
} | ||
static get Event() { | ||
@@ -584,3 +577,3 @@ return Event; | ||
_notifyEvent(e) { | ||
if ((e.type === DateTimePicker.Event.CHANGE && e.date && e.date.isSame(e.oldDate)) || !e.date && !e.oldDate) { | ||
if ((e.type === DateTimePicker.Event.CHANGE && (e.date && e.date.isSame(e.oldDate)) || !e.date && !e.oldDate)) { | ||
return; | ||
@@ -607,3 +600,3 @@ } | ||
if (dir) { | ||
this.currentViewMode = Math.max(MinViewModeNumber, Math.min(3, this.currentViewMode + dir)); | ||
this.currentViewMode = Math.max(this.MinViewModeNumber, Math.min(3, this.currentViewMode + dir)); | ||
} | ||
@@ -781,12 +774,12 @@ this.widget.find('.datepicker > div').hide().filter(`.datepicker-${DatePickerModes[this.currentViewMode].CLASS_NAME}`).show(); | ||
if (this._isEnabled('y')) { | ||
MinViewModeNumber = 2; | ||
this.MinViewModeNumber = 2; | ||
} | ||
if (this._isEnabled('M')) { | ||
MinViewModeNumber = 1; | ||
this.MinViewModeNumber = 1; | ||
} | ||
if (this._isEnabled('d')) { | ||
MinViewModeNumber = 0; | ||
this.MinViewModeNumber = 0; | ||
} | ||
this.currentViewMode = Math.max(MinViewModeNumber, this.currentViewMode); | ||
this.currentViewMode = Math.max(this.MinViewModeNumber, this.currentViewMode); | ||
@@ -1257,3 +1250,3 @@ if (!this.unset) { | ||
this._options.viewMode = viewMode; | ||
this.currentViewMode = Math.max(DateTimePicker.ViewModes.indexOf(viewMode) - 1, DateTimePicker.MinViewModeNumber); | ||
this.currentViewMode = Math.max(DateTimePicker.ViewModes.indexOf(viewMode) - 1, this.MinViewModeNumber); | ||
@@ -1260,0 +1253,0 @@ this._showMode(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
148842
7
2812