Seditio Source
Root |
./othercms/xenForo 2.2.8/js/xf/date_input.min.js
'use strict';!function(k,l,m,n){XF.DateInput=XF.Element.newHandler({options:{weekStart:0,minDate:null,maxDate:null,disableWeekends:!1,yearRange:null,showWeekNumber:!1,showDaysInNextAndPreviousMonths:!0},picker:null,init:function(){var e=this.options.minDate,f=this.options.maxDate;if(e){var c=Date.parse(e.replace(/-/g,"/"));e=new Date(c)}f&&(c=Date.parse(f.replace(/-/g,"/")),f=new Date(c));var g=this,h=this.$target;c=h.val();e={format:"YYYY-MM-DD",toString:function(a,d){d=a.getDate();const b=a.getMonth()+
1;return a.getFullYear()+"-"+b+"-"+d},parse:function(a,d){var b=a.split("-");a=parseInt(b[0],10);d=parseInt(b[1],10)-1;b=parseInt(b[2],10);return new Date(a,d,b)},onSelect:function(){var a=this._d,d=String(a.getDate()),b=String(a.getMonth()+1);a=String(a.getFullYear());g.$target.val(a+"-"+(10>b?"0"+b:b)+"-"+(10>d?"0"+d:d))},onOpen:function(){h.prop("readonly")&&this.hide()},showTime:!1,firstDay:this.options.weekStart,minDate:e,maxDate:f,disableWeekends:this.options.disableWeekends,yearRange:this.options.yearRange,
showWeekNumber:this.options.showWeekNumber,showDaysInNextAndPreviousMonths:this.options.showDaysInNextAndPreviousMonths,i18n:{previousMonth:"",nextMonth:"",weekdays:[0,1,2,3,4,5,6].map(function(a){return XF.phrase("day"+a)}),weekdaysShort:[0,1,2,3,4,5,6].map(function(a){return XF.phrase("dayShort"+a)}),months:[0,1,2,3,4,5,6,7,8,9,10,11].map(function(a){return XF.phrase("month"+a)})},isRTL:!1,field:this.$target[0]};c&&(f=c.match(/^(\d{4})-(\d\d?)-(\d\d?)$/))&&(e.defaultDate=new Date(parseInt(f[1],
10),parseInt(f[2],10)-1,parseInt(f[3])),e.setDefaultDate=!0);this.picker=new Pikaday(e);this.$target.val(c);c=this.$target.parent().find(".js-dateTrigger");if(c.length)c.on("click",function(){g.picker.show()})}});XF.Element.register("date-input","XF.DateInput")}(jQuery,window,document);