File manager - Edit - /home/asiatechinc/public_html/asiatech-websites/corbettriviera.com/js/pikaday.js
Back
/*! * Pikaday * * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday */ !function(t,e){"use strict";var n;if("object"==typeof exports){try{n=require("moment")}catch(i){}module.exports=e(n)}else"function"==typeof define&&define.amd?define(function(t){try{n=t("moment")}catch(i){}return e(n)}):t.Pikaday=e(t.moment)}(this,function(t){"use strict";var e="function"==typeof t,n=!!window.addEventListener,i=window.document,a=window.setTimeout,s=function(t,e,i,a){n?t.addEventListener(e,i,!!a):t.attachEvent("on"+e,i)},o=function(t,e,i,a){n?t.removeEventListener(e,i,!!a):t.detachEvent("on"+e,i)},r=function(t,e,n){var a;i.createEvent?((a=i.createEvent("HTMLEvents")).initEvent(e,!0,!1),a=y(a,n),t.dispatchEvent(a)):i.createEventObject&&(a=y(a=i.createEventObject(),n),t.fireEvent("on"+e,a))},h=function(t,e){return -1!==(" "+t.className+" ").indexOf(" "+e+" ")},l=function(t,e){h(t,e)||(t.className=""===t.className?e:t.className+" "+e)},d=function(t,e){var n;t.className=(n=(" "+t.className+" ").replace(" "+e+" "," ")).trim?n.trim():n.replace(/^\s+|\s+$/g,"")},u=function(t){return/Array/.test(Object.prototype.toString.call(t))},c=function(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())},f=function(t){var e=t.getDay();return 0===e||6===e},g=function(t,e){var n;return[31,(n=t)%4==0&&n%100!=0||n%400==0?29:28,31,30,31,30,31,31,30,31,30,31][e]},m=function(t){c(t)&&t.setHours(0,0,0,0)},p=function(t,e){return t.getTime()===e.getTime()},y=function(t,e,n){var i,a;for(i in e)(a=void 0!==t[i])&&"object"==typeof e[i]&&null!==e[i]&&void 0===e[i].nodeName?c(e[i])?n&&(t[i]=new Date(e[i].getTime())):u(e[i])?n&&(t[i]=e[i].slice(0)):t[i]=y({},e[i],n):(n||!a)&&(t[i]=e[i]);return t},v=function(t){return t.month<0&&(t.year-=Math.ceil(Math.abs(t.month)/12),t.month+=12),t.month>11&&(t.year+=Math.floor(Math.abs(t.month)/12),t.month-=12),t},$={field:null,bound:void 0,position:"bottom left",reposition:!0,format:"YYYY-MM-DD",defaultDate:null,setDefaultDate:!1,firstDay:0,formatStrict:!1,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,i18n:{previousMonth:"Previous Month",nextMonth:"Next Month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},theme:null,onSelect:null,onOpen:null,onClose:null,onDraw:null},b=function(t,e,n){for(e+=t.firstDay;e>=7;)e-=7;return n?t.i18n.weekdaysShort[e]:t.i18n.weekdays[e]},_=function(t){var e=[];if(t.isEmpty){if(!t.showDaysInNextAndPreviousMonths)return'<td class="is-empty"></td>';e.push("is-outside-current-month")}return t.isDisabled&&e.push("is-disabled"),t.isToday&&e.push("is-today"),t.isSelected&&e.push("is-selected"),t.isInRange&&e.push("is-inrange"),t.isStartRange&&e.push("is-startrange"),t.isEndRange&&e.push("is-endrange"),'<td data-day="'+t.day+'" class="'+e.join(" ")+'"><button class="pika-button pika-day" type="button" data-pika-year="'+t.year+'" data-pika-month="'+t.month+'" data-pika-day="'+t.day+'">'+t.day+"</button></td>"},D=function(t,e,n){var i=new Date(n,0,1);return'<td class="pika-week">'+Math.ceil(((new Date(n,e,t)-i)/864e5+i.getDay()+1)/7)+"</td>"},M=function(t){var e,n=[];for(t.showWeekNumber&&n.push("<th></th>"),e=0;e<7;e++)n.push('<th scope="col"><abbr title="'+b(t,e)+'">'+b(t,e,!0)+"</abbr></th>");return"<thead><tr>"+(t.isRTL?n.reverse():n).join("")+"</tr></thead>"},w=function(t,e,n,i,a){var s,o,r,h,l,d=t._o,c=n===d.minYear,f=n===d.maxYear,g='<div class="pika-title">',m=!0,p=!0;for(r=[],s=0;s<12;s++)r.push('<option value="'+(n===a?s-e:12+s-e)+'"'+(s===i?' selected="selected"':"")+(c&&s<d.minMonth||f&&s>d.maxMonth?'disabled="disabled"':"")+">"+d.i18n.months[s]+"</option>");for(h='<div class="pika-label">'+d.i18n.months[i]+'<select class="pika-select pika-select-month" tabindex="-1">'+r.join("")+"</select></div>",u(d.yearRange)?(s=d.yearRange[0],o=d.yearRange[1]+1):(s=n-d.yearRange,o=1+n+d.yearRange),r=[];s<o&&s<=d.maxYear;s++)s>=d.minYear&&r.push('<option value="'+s+'"'+(s===n?' selected="selected"':"")+">"+s+"</option>");return l='<div class="pika-label">'+n+d.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+r.join("")+"</select></div>",d.showMonthAfterYear?g+=l+h:g+=h+l,c&&(0===i||d.minMonth>=i)&&(m=!1),f&&(11===i||d.maxMonth<=i)&&(p=!1),0===e&&(g+='<button class="pika-prev'+(m?"":" is-disabled")+'" type="button">'+d.i18n.previousMonth+"</button>"),e===t._o.numberOfMonths-1&&(g+='<button class="pika-next'+(p?"":" is-disabled")+'" type="button">'+d.i18n.nextMonth+"</button>"),g+"</div>"},k=function(t,e){var n;return'<table cellpadding="0" cellspacing="0" class="pika-table">'+M(t)+("<tbody>"+(n=e).join(""))+"</tbody></table>"},x=function(o){var r=this,l=r.config(o);r._onMouseDown=function(t){if(r._v){var e=(t=t||window.event).target||t.srcElement;if(e){if(!h(e,"is-disabled")&&(!h(e,"pika-button")||h(e,"is-empty")||h(e.parentNode,"is-disabled")?h(e,"pika-prev")?r.prevMonth():h(e,"pika-next")&&r.nextMonth():(r.setDate(new Date(e.getAttribute("data-pika-year"),e.getAttribute("data-pika-month"),e.getAttribute("data-pika-day"))),l.bound&&a(function(){r.hide(),l.field&&l.field.blur()},100))),h(e,"pika-select"))r._c=!0;else{if(!t.preventDefault)return t.returnValue=!1,!1;t.preventDefault()}}}},r._onChange=function(t){var e=(t=t||window.event).target||t.srcElement;e&&(h(e,"pika-select-month")?r.gotoMonth(e.value):h(e,"pika-select-year")&&r.gotoYear(e.value))},r._onInputChange=function(n){var i;n.firedBy!==r&&(i=e?(i=t(l.field.value,l.format,l.formatStrict))&&i.isValid()?i.toDate():null:new Date(Date.parse(l.field.value)),c(i)&&r.setDate(i),r._v||r.show())},r._onInputFocus=function(){r.show()},r._onInputClick=function(){r.show()},r._onInputBlur=function(){var t=i.activeElement;do if(h(t,"pika-single"))return;while(t=t.parentNode);r._c||(r._b=a(function(){r.hide()},50)),r._c=!1},r._onClick=function(t){var e=(t=t||window.event).target||t.srcElement,i=e;if(e){!n&&h(e,"pika-select")&&!e.onchange&&(e.setAttribute("onchange","return;"),s(e,"change",r._onChange));do if(h(i,"pika-single")||i===l.trigger)return;while(i=i.parentNode);r._v&&e!==l.trigger&&i!==l.trigger&&r.hide()}},r.el=i.createElement("div"),r.el.className="pika-single"+(l.isRTL?" is-rtl":"")+(l.theme?" "+l.theme:""),s(r.el,"mousedown",r._onMouseDown,!0),s(r.el,"touchend",r._onMouseDown,!0),s(r.el,"change",r._onChange),l.field&&(l.container?l.container.appendChild(r.el):l.bound?i.body.appendChild(r.el):l.field.parentNode.insertBefore(r.el,l.field.nextSibling),s(l.field,"change",r._onInputChange),l.defaultDate||(e&&l.field.value?l.defaultDate=t(l.field.value,l.format).toDate():l.defaultDate=new Date(Date.parse(l.field.value)),l.setDefaultDate=!0));var d=l.defaultDate;c(d)?l.setDefaultDate?r.setDate(d,!0):r.gotoDate(d):r.gotoDate(new Date),l.bound?(this.hide(),r.el.className+=" is-bound",s(l.trigger,"click",r._onInputClick),s(l.trigger,"focus",r._onInputFocus),s(l.trigger,"blur",r._onInputBlur)):this.show()};return x.prototype={config:function(t){this._o||(this._o=y({},$,!0));var e=y(this._o,t,!0);e.isRTL=!!e.isRTL,e.field=e.field&&e.field.nodeName?e.field:null,e.theme="string"==typeof e.theme&&e.theme?e.theme:null,e.bound=!!(void 0!==e.bound?e.field&&e.bound:e.field),e.trigger=e.trigger&&e.trigger.nodeName?e.trigger:e.field,e.disableWeekends=!!e.disableWeekends,e.disableDayFn="function"==typeof e.disableDayFn?e.disableDayFn:null;var n=parseInt(e.numberOfMonths,10)||1;if(e.numberOfMonths=n>4?4:n,c(e.minDate)||(e.minDate=!1),c(e.maxDate)||(e.maxDate=!1),e.minDate&&e.maxDate&&e.maxDate<e.minDate&&(e.maxDate=e.minDate=!1),e.minDate&&this.setMinDate(e.minDate),e.maxDate&&this.setMaxDate(e.maxDate),u(e.yearRange)){var i=new Date().getFullYear()-10;e.yearRange[0]=parseInt(e.yearRange[0],10)||i,e.yearRange[1]=parseInt(e.yearRange[1],10)||i}else e.yearRange=Math.abs(parseInt(e.yearRange,10))||$.yearRange,e.yearRange>100&&(e.yearRange=100);return e},toString:function(n){return c(this._d)?e?t(this._d).format(n||this._o.format):this._d.toDateString():""},getMoment:function(){return e?t(this._d):null},setMoment:function(n,i){e&&t.isMoment(n)&&this.setDate(n.toDate(),i)},getDate:function(){return c(this._d)?new Date(this._d.getTime()):null},setDate:function(t,e){if(!t)return this._d=null,this._o.field&&(this._o.field.value="",r(this._o.field,"change",{firedBy:this})),this.draw();if("string"==typeof t&&(t=new Date(Date.parse(t))),c(t)){var n=this._o.minDate,i=this._o.maxDate;c(n)&&t<n?t=n:c(i)&&t>i&&(t=i),this._d=new Date(t.getTime()),m(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),r(this._o.field,"change",{firedBy:this})),e||"function"!=typeof this._o.onSelect||this._o.onSelect.call(this,this.getDate())}},gotoDate:function(t){var e=!0;if(c(t)){if(this.calendars){var n=new Date(this.calendars[0].year,this.calendars[0].month,1),i=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),a=t.getTime();i.setMonth(i.getMonth()+1),i.setDate(i.getDate()-1),e=a<n.getTime()||i.getTime()<a}e&&(this.calendars=[{month:t.getMonth(),year:t.getFullYear()}],"right"===this._o.mainCalendar&&(this.calendars[0].month+=1-this._o.numberOfMonths)),this.adjustCalendars()}},adjustCalendars:function(){this.calendars[0]=v(this.calendars[0]);for(var t=1;t<this._o.numberOfMonths;t++)this.calendars[t]=v({month:this.calendars[0].month+t,year:this.calendars[0].year});this.draw()},gotoToday:function(){this.gotoDate(new Date)},gotoMonth:function(t){isNaN(t)||(this.calendars[0].month=parseInt(t,10),this.adjustCalendars())},nextMonth:function(){this.calendars[0].month++,this.adjustCalendars()},prevMonth:function(){this.calendars[0].month--,this.adjustCalendars()},gotoYear:function(t){isNaN(t)||(this.calendars[0].year=parseInt(t,10),this.adjustCalendars())},setMinDate:function(t){m(t),this._o.minDate=t,this._o.minYear=t.getFullYear(),this._o.minMonth=t.getMonth(),this.draw()},setMaxDate:function(t){m(t),this._o.maxDate=t,this._o.maxYear=t.getFullYear(),this._o.maxMonth=t.getMonth(),this.draw()},setStartRange:function(t){this._o.startRange=t},setEndRange:function(t){this._o.endRange=t},draw:function(t){if(this._v||t){var e=this._o,n=e.minYear,i=e.maxYear,s=e.minMonth,o=e.maxMonth,r="";this._y<=n&&(this._y=n,!isNaN(s)&&this._m<s&&(this._m=s)),this._y>=i&&(this._y=i,!isNaN(o)&&this._m>o&&(this._m=o));for(var h=0;h<e.numberOfMonths;h++)r+='<div class="pika-lendar">'+w(this,h,this.calendars[h].year,this.calendars[h].month,this.calendars[0].year)+this.render(this.calendars[h].year,this.calendars[h].month)+"</div>";this.el.innerHTML=r,e.bound&&"hidden"!==e.field.type&&a(function(){e.trigger.focus()},1),"function"==typeof this._o.onDraw&&this._o.onDraw(this)}},adjustPosition:function(){var t,e,n,a,s,o,r,h,l,d;if(!this._o.container){if(this.el.style.position="absolute",e=t=this._o.trigger,n=this.el.offsetWidth,a=this.el.offsetHeight,s=window.innerWidth||i.documentElement.clientWidth,o=window.innerHeight||i.documentElement.clientHeight,r=window.pageYOffset||i.body.scrollTop||i.documentElement.scrollTop,"function"==typeof t.getBoundingClientRect)h=(d=t.getBoundingClientRect()).left+window.pageXOffset,l=d.bottom+window.pageYOffset;else for(h=e.offsetLeft,l=e.offsetTop+e.offsetHeight;e=e.offsetParent;)h+=e.offsetLeft,l+=e.offsetTop;(this._o.reposition&&h+n>s||this._o.position.indexOf("right")>-1&&h-n+t.offsetWidth>0)&&(h=h-n+t.offsetWidth),(this._o.reposition&&l+a>o+r||this._o.position.indexOf("top")>-1&&l-a-t.offsetHeight>0)&&(l=l-a-t.offsetHeight),this.el.style.left=h+"px",this.el.style.top=l+"px"}},render:function(t,e){var n=this._o,i=new Date,a=g(t,e),s=new Date(t,e,1).getDay(),o=[],r=[];m(i),n.firstDay>0&&(s-=n.firstDay)<0&&(s+=7);for(var h=0===e?11:e-1,l=11===e?0:e+1,d=0===e?t-1:t,u=11===e?t+1:t,y=g(d,h),v=a+s,$=v;$>7;)$-=7;v+=7-$;for(var b=0,M=0;b<v;b++){var w,x,R=new Date(t,e,1+(b-s)),C=!!c(this._d)&&p(R,this._d),T=p(R,i),E=b<s||b>=a+s,N=1+(b-s),S=e,Y=t,O=n.startRange&&p(n.startRange,R),j=n.endRange&&p(n.endRange,R),I=n.startRange&&n.endRange&&n.startRange<R&&R<n.endRange,F=n.minDate&&R<n.minDate||n.maxDate&&R>n.maxDate||n.disableWeekends&&f(R)||n.disableDayFn&&n.disableDayFn(R);E&&(b<s?(N=y+N,S=h,Y=d):(N-=a,S=l,Y=u));var A={day:N,month:S,year:Y,isSelected:C,isToday:T,isDisabled:F,isEmpty:E,isStartRange:O,isEndRange:j,isInRange:I,showDaysInNextAndPreviousMonths:n.showDaysInNextAndPreviousMonths};r.push(_(A)),7==++M&&(n.showWeekNumber&&r.unshift(D(b-s,e,t)),o.push((w=r,"<tr>"+((x=n.isRTL)?w.reverse():w).join("")+"</tr>")),r=[],M=0)}return k(n,o)},isVisible:function(){return this._v},show:function(){this._v||(d(this.el,"is-hidden"),this._v=!0,this.draw(),this._o.bound&&(s(i,"click",this._onClick),this.adjustPosition()),"function"==typeof this._o.onOpen&&this._o.onOpen.call(this))},hide:function(){var t=this._v;!1!==t&&(this._o.bound&&o(i,"click",this._onClick),this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto",l(this.el,"is-hidden"),this._v=!1,void 0!==t&&"function"==typeof this._o.onClose&&this._o.onClose.call(this))},destroy:function(){this.hide(),o(this.el,"mousedown",this._onMouseDown,!0),o(this.el,"touchend",this._onMouseDown,!0),o(this.el,"change",this._onChange),this._o.field&&(o(this._o.field,"change",this._onInputChange),this._o.bound&&(o(this._o.trigger,"click",this._onInputClick),o(this._o.trigger,"focus",this._onInputFocus),o(this._o.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}},x});
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings