core/skin/plugins/bootstrap-material-datetime.../js/bootstrap-material-datetime...

2 lines
23 KiB
JavaScript
Raw Normal View History

2022-12-11 13:55:49 +05:00
!function(t,e){function i(i,a){this.currentView=0,this.minDate,this.maxDate,this._attachedEvents=[],this.element=i,this.$element=t(i),this.params={date:!0,time:!0,format:"YYYY-MM-DD",minDate:null,maxDate:null,currentDate:null,lang:"en",weekStart:0,shortTime:!1,clearButton:!1,nowButton:!1,cancelText:"Cancel",okText:"OK",clearText:"Clear",nowText:"Now",switchOnClick:!1},this.params=t.fn.extend(this.params,a),this.name="dtp_"+this.setName(),this.$element.attr("data-dtp",this.name),e.locale(this.params.lang),this.init()}var a="bootstrapMaterialDatePicker",s="plugin_"+a;e.locale("en"),t.fn[a]=function(e,a){return this.each(function(){t.data(this,s)?("function"==typeof t.data(this,s)[e]&&t.data(this,s)[e](a),"destroy"===e&&delete t.data(this,s)):t.data(this,s,new i(this,e))}),this},i.prototype={init:function(){this.initDays(),this.initDates(),this.initTemplate(),this.initButtons(),this._attachEvent(t(window),"resize",this._centerBox.bind(this)),this._attachEvent(this.$dtpElement.find(".dtp-content"),"click",this._onElementClick.bind(this)),this._attachEvent(this.$dtpElement,"click",this._onBackgroundClick.bind(this)),this._attachEvent(this.$dtpElement.find(".dtp-close > a"),"click",this._onCloseClick.bind(this)),this._attachEvent(this.$element,"focus",this._onFocus.bind(this))},initDays:function(){this.days=[];for(var t=this.params.weekStart;this.days.length<7;t++)t>6&&(t=0),this.days.push(t.toString())},initDates:function(){if(this.$element.val().length>0)"undefined"!=typeof this.params.format&&null!==this.params.format?this.currentDate=e(this.$element.val(),this.params.format).locale(this.params.lang):this.currentDate=e(this.$element.val()).locale(this.params.lang);else if("undefined"!=typeof this.$element.attr("value")&&null!==this.$element.attr("value")&&""!==this.$element.attr("value"))"string"==typeof this.$element.attr("value")&&("undefined"!=typeof this.params.format&&null!==this.params.format?this.currentDate=e(this.$element.attr("value"),this.params.format).locale(this.params.lang):this.currentDate=e(this.$element.attr("value")).locale(this.params.lang));else if("undefined"!=typeof this.params.currentDate&&null!==this.params.currentDate){if("string"==typeof this.params.currentDate)"undefined"!=typeof this.params.format&&null!==this.params.format?this.currentDate=e(this.params.currentDate,this.params.format).locale(this.params.lang):this.currentDate=e(this.params.currentDate).locale(this.params.lang);else if("undefined"==typeof this.params.currentDate.isValid||"function"!=typeof this.params.currentDate.isValid){var t=this.params.currentDate.getTime();this.currentDate=e(t,"x").locale(this.params.lang)}else this.currentDate=this.params.currentDate;this.$element.val(this.currentDate.format(this.params.format))}else this.currentDate=e();if("undefined"!=typeof this.params.minDate&&null!==this.params.minDate)if("string"==typeof this.params.minDate)"undefined"!=typeof this.params.format&&null!==this.params.format?this.minDate=e(this.params.minDate,this.params.format).locale(this.params.lang):this.minDate=e(this.params.minDate).locale(this.params.lang);else if("undefined"==typeof this.params.minDate.isValid||"function"!=typeof this.params.minDate.isValid){var t=this.params.minDate.getTime();this.minDate=e(t,"x").locale(this.params.lang)}else this.minDate=this.params.minDate;else null===this.params.minDate&&(this.minDate=null);if("undefined"!=typeof this.params.maxDate&&null!==this.params.maxDate)if("string"==typeof this.params.maxDate)"undefined"!=typeof this.params.format&&null!==this.params.format?this.maxDate=e(this.params.maxDate,this.params.format).locale(this.params.lang):this.maxDate=e(this.params.maxDate).locale(this.params.lang);else if("undefined"==typeof this.params.maxDate.isValid||"function"!=typeof this.params.maxDate.isValid){var t=this.params.maxDate.getTime();this.maxDate=e(t,"x").locale(this.params.lang)}else this.maxDate=this.params.maxDate;else null===this.params.maxDate&&(this.maxDate=null);this.isAfterMinDate(this.currentDate)||(this.currentDate=e(this.minDate)),this.isBeforeMaxDate(this.currentDate)||(
//# sourceMappingURL=bootstrap-material-datetimepicker.min.js.map