CoreFiles by mySites.guru
calendar.min.js1 lines, 24,920 bytes, from Joomla_4.0.0-rc4-Release_Candidate-Full_Package.zip
Raw History Compare with 4.0.0-rc3
md5
85ded831d5e494281993605980921a25
sha1
714b89ecb456ee655a962f0cd8761f5088c85779
sha256
d81ae6571c50d7b08a81942e01fe1144f7c999728e953d5a380a7b55a631498d
!function(e,a){"use strict";Date.convertNumbers=function(e){e=e.toString();if("[object Array]"===Object.prototype.toString.call(JoomlaCalLocale.localLangNumbers))for(var a=0;a<JoomlaCalLocale.localLangNumbers.length;a++)e=e.replace(new RegExp(a,"g"),JoomlaCalLocale.localLangNumbers[a]);return e},Date.toEnglish=function(e){e=this.toString();for(var a=[0,1,2,3,4,5,6,7,8,9],t=0;t<10;t++)e=e.replace(new RegExp(a[t],"g"),t);return e};var t=function(e){if(!e)throw new Error("Calendar setup failed:\n  No valid element found, Please check your code");if("function"!=typeof Date.parseFieldDate)throw new Error("Calendar setup failed:\n  No valid date helper, Please check your code");if(e._joomlaCalendar)throw new Error("JoomlaCalendar instance already exists for the element");if(e._joomlaCalendar=this,this.writable=!0,this.hidden=!0,this.params={},this.element=e,this.inputField=e.getElementsByTagName("input")[0],this.button=e.getElementsByTagName("button")[0],!this.inputField)throw new Error("Calendar setup failed:\n  No valid input found, Please check your code");this.params={debug:!1,clicked:!1,element:{style:{display:"none"}},writable:!0};var t=this,s=this.button,l={inputField:this.inputField,dateType:JoomlaCalLocale.dateType?JoomlaCalLocale.dateType:"gregorian",direction:void 0!==a.dir?a.dir:a.getElementsByTagName("html")[0].getAttribute("dir"),firstDayOfWeek:s.getAttribute("data-firstday")?parseInt(s.getAttribute("data-firstday")):0,dateFormat:"%Y-%m-%d %H:%M:%S",weekend:JoomlaCalLocale.weekend?JoomlaCalLocale.weekend:[0,6],minYear:JoomlaCalLocale.minYear?JoomlaCalLocale.minYear:1900,maxYear:JoomlaCalLocale.maxYear?JoomlaCalLocale.maxYear:2100,minYearTmp:s.getAttribute("data-min-year"),maxYearTmp:s.getAttribute("data-max-year"),weekendTmp:s.getAttribute("data-weekend"),time24:!0,showsOthers:1===parseInt(s.getAttribute("data-show-others")),showsTime:!0,weekNumbers:1===parseInt(s.getAttribute("data-week-numbers")),showsTodayBtn:!0,compressedHeader:1===parseInt(s.getAttribute("data-only-months-nav"))};for(var i in s.getAttribute("data-dayformat")&&(l.dateFormat=s.getAttribute("data-dayformat")?s.getAttribute("data-dayformat"):"%Y-%m-%d %H:%M:%S"),s.getAttribute("data-time-24")&&(l.time24=24===parseInt(s.getAttribute("data-time-24"))),s.getAttribute("data-show-time")&&(l.showsTime=1===parseInt(s.getAttribute("data-show-time"))),s.getAttribute("data-today-btn")&&(l.showsTodayBtn=1===parseInt(s.getAttribute("data-today-btn"))),l)this.params[i]=l[i];r(t.params.minYearTmp)&&(t.params.minYear=o(parseInt(t.params.minYearTmp),t.params.dateType)),r(t.params.maxYearTmp)&&(t.params.maxYear=o(parseInt(t.params.maxYearTmp),t.params.dateType)),"undefined"!==t.params.weekendTmp&&(t.params.weekend=t.params.weekendTmp.split(",").map((function(e){return parseInt(e,10)}))),this._dayMouseDown=function(e){return t._handleDayMouseDown(e)},this._calKeyEvent=function(e){return t._handleCalKeyEvent(e)},this._documentClick=function(e){return t._handleDocumentClick(e)},this.checkInputs(),this.inputField.getAttribute("readonly")||(this._create(),this._bindEvents())};t.prototype.checkInputs=function(){var e=Date.parseFieldDate(this.inputField.getAttribute("data-alt-value"),this.params.dateFormat,"gregorian");""!==this.inputField.value?(this.date=e,this.inputField.value=e.print(this.params.dateFormat,this.params.dateType,!0)):this.date=new Date},t.prototype.recreate=function(){var e=this.element,a=e.querySelector(".js-calendar");a&&(e._joomlaCalendar=null,a.parentNode.removeChild(a),new t(e))},t.prototype.updateTime=function(e,a,t){var s=this,l=s.date,r=s.date.getLocalDate(s.params.dateType),o=s.date.getLocalMonth(s.params.dateType),i=s.date.getLocalFullYear(s.params.dateType),n=this.inputField.parentNode.parentNode.querySelectorAll(".time-ampm")[0];s.params.time24||(/pm/i.test(n.value)&&e<12?e=parseInt(e)+12:/am/i.test(n.value)&&12==e&&(e=0)),l.setHours(e),l.setMinutes(parseInt(a,10)),l.setSeconds(l.getSeconds()),l.setLocalFullYear(s.params.dateType,i),l.setLocalMonth(s.params.dateType,o),l.setLocalDate(s.params.dateType,r),s.dateClicked=!1,this.callHandler()},t.prototype.setDate=function(e){e.equalsTo(this.date)||(this.date=e,this.processCalendar(this.params.firstDayOfWeek,e))},t.prototype.moveCursorBy=function(e){var a=new Date(this.date);a.setDate(a.getDate()-e),this.setDate(a)},t.prototype.resetSelected=function(e){for(var a=e.options,t=a.length;t--;){var s=a[t];s.selected&&(s.selected=!1)}},t.prototype.callHandler=function(){this.inputField.setAttribute("data-alt-value",this.date.print(this.params.dateFormat,"gregorian",!1)),this.inputField.getAttribute("data-alt-value")&&"0000-00-00 00:00:00"!==this.inputField.getAttribute("data-alt-value")&&(this.inputField.value=this.date.print(this.params.dateFormat,this.params.dateType,!0),"gregorian"!==this.params.dateType&&this.inputField.setAttribute("data-local-value",this.date.print(this.params.dateFormat,this.params.dateType,!0))),this.inputField.value=this.date.print(this.params.dateFormat,this.params.dateType,!0),this.dateClicked&&"function"==typeof this.params.onUpdate&&this.params.onUpdate(this),this.inputField.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0})),this.dateClicked?this.close():this.processCalendar()},t.prototype.close=function(){this.hide()},t.prototype.show=function(){this.checkInputs(),this.inputField.focus(),this.dropdownElement.classList.remove("hidden"),this.hidden=!1,a.addEventListener("keydown",this._calKeyEvent,!0),a.addEventListener("keypress",this._calKeyEvent,!0),a.addEventListener("mousedown",this._documentClick,!0);var t=this.element.querySelector(".js-calendar");e.innerHeight<t.getBoundingClientRect().bottom+20&&(t.style.marginTop=-(t.getBoundingClientRect().height+this.inputField.getBoundingClientRect().height)+"px"),this.processCalendar()},t.prototype.hide=function(){a.removeEventListener("keydown",this._calKeyEvent,!0),a.removeEventListener("keypress",this._calKeyEvent,!0),a.removeEventListener("mousedown",this._documentClick,!0),this.dropdownElement.classList.add("hidden"),this.hidden=!0},t.prototype._handleDocumentClick=function(e){var t=e.target;if(null!==t&&!t.classList.contains("time"))for(;null!==t&&t!==this.element;t=t.parentNode);if(null===t)return a.activeElement.blur(),this.hide(),s(e)},t.prototype._handleDayMouseDown=function(e){var a=this,t=e.currentTarget,l=e.target||e.srcElement;if(!l||!l.hasAttribute("data-action")){if("TD"!==t.nodeName){var r=t.getParent("TD");"TD"===r.nodeName?t=r:(t=t.getParent("TD")).classList.contains("js-calendar")&&(t=t.getElementsByTagName("table")[0])}else if(!l.classList.contains("js-btn")&&!t.classList.contains("day")&&!t.classList.contains("title"))return;if(!t||t.disabled)return!1;if(void 0===t.navtype||300!==t.navtype){50===t.navtype&&(t._current=t.innerHTML),l!==t&&l.parentNode!==t||a.cellClick(t,e);var o=null;void 0!==t.month&&(o=t),void 0!==t.parentNode.month&&(o=t.parentNode);var i=null;if(o)i=new Date(a.date),o.month!==i.getLocalMonth(a.params.dateType)&&(i.setLocalMonth(a.params.dateType,o.month),a.setDate(i),a.dateClicked=!1,this.callHandler());else{var n=null;void 0!==t.year&&(n=l),void 0!==t.parentNode.year&&(n=l.parentNode),n&&(i=new Date(a.date),n.year!==i.getLocalFullYear(a.params.dateType)&&(i.setFullYear(a.params.dateType,n.year),a.setDate(i),a.dateClicked=!1,this.callHandler()))}}return s(e)}},t.prototype.cellClick=function(e,a){var t=this,s=!1,l=!1,r=null;if(void 0===e.navtype){t.currentDateEl&&(e.classList.add("selected"),t.currentDateEl=e.caldate,(s=t.currentDateEl===e.caldate)||(t.currentDateEl=e.caldate)),t.date.setLocalDateOnly("gregorian",e.caldate);var o=!(t.dateClicked=!e.otherMonth);t.currentDateEl&&(l=!e.disabled),o&&this.processCalendar()}else{r=new Date(t.date),t.dateClicked=!1;var i=r.getOtherFullYear(t.params.dateType),n=r.getLocalMonth(t.params.dateType);switch(e.navtype){case 400:break;case-2:t.params.compressedHeader||i>t.params.minYear&&r.setOtherFullYear(t.params.dateType,i-1);break;case-1:var d=r.getLocalDate(t.params.dateType);if(n>0)d>(m=r.getLocalMonthDays(t.params.dateType,n-1))&&r.setLocalDate(t.params.dateType,m),r.setLocalMonth(t.params.dateType,n-1);else if(i-- >t.params.minYear){r.setOtherFullYear(t.params.dateType,i),d>(m=r.getLocalMonthDays(t.params.dateType,11))&&r.setLocalDate(t.params.dateType,m),r.setLocalMonth(t.params.dateType,11)}break;case 1:d=r.getLocalDate(t.params.dateType);if(n<11)d>(m=r.getLocalMonthDays(t.params.dateType,n+1))&&r.setLocalDate(t.params.dateType,m),r.setLocalMonth(t.params.dateType,n+1);else if(i<t.params.maxYear){var m;r.setOtherFullYear(t.params.dateType,i+1),d>(m=r.getLocalMonthDays(t.params.dateType,0))&&r.setLocalDate(t.params.dateType,m),r.setLocalMonth(t.params.dateType,0)}break;case 2:t.params.compressedHeader||i<t.params.maxYear&&r.setOtherFullYear(t.params.dateType,i+1)}r.equalsTo(t.date)?0===e.navtype&&(l=s=!0):(this.setDate(r),l=!0)}l&&(t.params.showsTime&&(this.dateClicked=!1),a&&this.callHandler()),e.classList.remove("hilite"),s&&!t.params.showsTime&&(t.dateClicked=!1,a&&this.close())},t.prototype._handleCalKeyEvent=function(e){var a=this,t=e.keyCode;if(e.target!==this.inputField||13!==t&&9!==t||this.close(),"rtl"===a.params.direction&&(37===t?t=39:39===t&&(t=37)),32===t&&e.shiftKey&&(e.preventDefault(),this.cellClick(a._nav_now,e),a.close()),27===t&&this.close(),38===t&&this.moveCursorBy(7),40===t&&this.moveCursorBy(-7),37===t&&this.moveCursorBy(1),39===t&&this.moveCursorBy(-1),e.target===this.inputField&&!(t>48||t<57||186===t||189===t||190===t||32===t))return s(e)},t.prototype._create=function(){var e=this,a=this.element,t=l("table"),s=l("div");this.table=t,t.className="table",t.style.marginBottom=0,this.dropdownElement=s,a.appendChild(s),this.params.direction&&(s.style.direction=this.params.direction),s.className="js-calendar",s.style.position="absolute",s.style.boxShadow="0 0 70px 0 rgba(0,0,0,0.67)",s.style.minWidth=this.inputField.width,s.style.padding="0",s.classList.add("hidden"),s.style.left="auto",s.style.top="auto",s.style.zIndex=1060,s.style.borderRadius="20px",this.wrapper=l("div"),this.wrapper.className="calendar-container",s.appendChild(this.wrapper),this.wrapper.appendChild(t);var r=l("thead",t);r.className="calendar-header";var o=null,i=null,n=this,d=function(a,t,s,r,d,m,p){for(var c in d=d||{},o=l(r=r||"td",i),t&&(m=m?'class="'+m+'"':"",o.colSpan=t),d)o.style[c]=d[c];for(var c in p)o.setAttribute(c,p[c]);return 0!==s&&Math.abs(s)<=2&&(o.className+=" nav"),t&&o.addEventListener("mousedown",e._dayMouseDown,!0),o.calendar=n,o.navtype=s,0!==s&&Math.abs(s)<=2?o.innerHTML=Joomla.sanitizeHtml("<a "+m+" style='display:inline;padding:2px 6px;cursor:pointer;text-decoration:none;' unselectable='on'>"+a+"</a>"):(o.innerHTML=t?Joomla.sanitizeHtml("<div unselectable='on'"+m+">"+a+"</div>"):Joomla.sanitizeHtml(a),!t&&m&&(o.className=m)),o};!1===this.params.compressedHeader&&((i=l("tr",r)).className="calendar-head-row",this._nav_py=d("&lsaquo;",1,-2,"",{"text-align":"center","font-size":"18px","line-height":"18px"},"js-btn btn-prev-year"),this.title=d('<div style="text-align:center;font-size:18px"><span></span></div>',this.params.weekNumbers?6:5,300),this.title.className="title",this._nav_ny=d(" &rsaquo;",1,2,"",{"text-align":"center","font-size":"18px","line-height":"18px"},"js-btn btn-next-year")),(i=l("tr",r)).className="calendar-head-row",this._nav_pm=d("&lsaquo;",1,-1,"",{"text-align":"center","font-size":"2em","line-height":"1em"},"js-btn btn-prev-month"),this._nav_month=d('<div style="text-align:center;font-size:1.2em"><span></span></div>',this.params.weekNumbers?6:5,888,"td",{textAlign:"center"}),this._nav_month.className="title",this._nav_nm=d(" &rsaquo;",1,1,"",{"text-align":"center","font-size":"2em","line-height":"1em"},"js-btn btn-next-month"),(i=l("tr",r)).className=e.params.weekNumbers?"daynames wk":"daynames",this.params.weekNumbers&&((o=l("td",i)).className="day-name wn",o.innerHTML=Joomla.sanitizeHtml(JoomlaCalLocale.wk));for(var m=7;m>0;--m)o=l("td",i),m||(o.calendar=e);this.firstdayname=this.params.weekNumbers?i.firstChild.nextSibling:i.firstChild;var p=this.params.firstDayOfWeek,c=(o=this.firstdayname,JoomlaCalLocale.weekend);for(m=0;m<7;++m){var u=(m+p)%7;o.classList.add("day-name"),this.params.weekNumbers&&o.classList.add("day-name-week"),m&&(o.calendar=e,o.fdow=u),-1!==c.indexOf(c)&&o.classList.add("weekend"),o.innerHTML=Joomla.sanitizeHtml(JoomlaCalLocale.shortDays[(m+p)%7]),o=o.nextSibling}var h=l("tbody",t);for(this.tbody=h,m=6;m>0;--m){i=l("tr",h),this.params.weekNumbers&&(o=l("td",i));for(var y=7;y>0;--y)(o=l("td",i)).calendar=this,o.addEventListener("mousedown",this._dayMouseDown,!0)}if(this.params.showsTime){(i=l("tr",h)).className="time",(o=l("td",i)).className="time time-title",o.colSpan=1,o.style.verticalAlign="middle",o.innerHTML=" ";var v=l("td",i);v.className="time hours-select",v.colSpan=2;var g=l("td",i);g.className="time minutes-select",g.colSpan=2,function(){function a(a,t,s,r,o){var i,n=l("select",o);n.calendar=e,n.className=a,n.setAttribute("data-chosen",!0),n.style.width="100%",n.navtype=50,n._range=[];for(var d=s;d<=r;++d){var m,p="";d===t&&(p=!0),d<10&&r>=10?(i="0"+d,m=Date.convertNumbers("0")+Date.convertNumbers(d)):(i=""+d,m=""+Date.convertNumbers(d)),n.options.add(new Option(m,i,p,p))}return n}var t=e.date.getHours(),s=e.date.getMinutes(),r=!e.params.time24,n=e.date.getHours()>12;r&&n&&(t-=12);var d=a("time time-hours",t,r?1:0,r?12:23,v),m=a("time time-minutes",s,0,59,g);if((o=l("td",i)).className="time ampm-select",o.colSpan=e.params.weekNumbers?1:2,r){var p=!0;n=Date.parseFieldDate(e.inputField.getAttribute("data-alt-value"),e.params.dateFormat,"gregorian").getHours()>=12;var c=l("select",o);c.className="time-ampm",c.style.width="100%",c.options.add(new Option(JoomlaCalLocale.PM,"pm",n?p:"",n?p:"")),c.options.add(new Option(JoomlaCalLocale.AM,"am",n?"":p,n?"":p)),c.addEventListener("change",(function(a){e.updateTime(a.target.parentNode.parentNode.childNodes[1].childNodes[0].value,a.target.parentNode.parentNode.childNodes[2].childNodes[0].value,a.target.parentNode.parentNode.childNodes[3].childNodes[0].value)}),!1)}else o.innerHTML="&#160;",o.colSpan=e.params.weekNumbers?3:2;d.addEventListener("change",(function(a){e.updateTime(a.target.parentNode.parentNode.childNodes[1].childNodes[0].value,a.target.parentNode.parentNode.childNodes[2].childNodes[0].value,a.target.parentNode.parentNode.childNodes[3].childNodes[0].value)}),!1),m.addEventListener("change",(function(a){e.updateTime(a.target.parentNode.parentNode.childNodes[1].childNodes[0].value,a.target.parentNode.parentNode.childNodes[2].childNodes[0].value,a.target.parentNode.parentNode.childNodes[3].childNodes[0].value)}),!1)}()}((i=l("div",this.wrapper)).className="buttons-wrapper btn-group",this._nav_clear=d(JoomlaCalLocale.clear,"",100,"button","","js-btn btn btn-clear",{type:"button","data-action":"clear"}),i.querySelector('[data-action="clear"]').addEventListener("click",(function(a){a.preventDefault();for(var t=e.table.querySelectorAll("td"),s=0;s<t.length;s++)if(t[s].classList.contains("selected")){t[s].classList.remove("selected");break}e.inputField.setAttribute("data-alt-value","0000-00-00 00:00:00"),e.inputField.setAttribute("value",""),e.inputField.value="",e.inputField.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0}))})),this.params.showsTodayBtn)&&(this._nav_now=d(JoomlaCalLocale.today,"",0,"button","","js-btn btn btn-today",{type:"button","data-action":"today"}),this.wrapper.querySelector('[data-action="today"]').addEventListener("click",(function(a){a.preventDefault(),e.date.setLocalDateOnly("gregorian",new Date),e.dateClicked=!0,e.callHandler(),e.close()})));this._nav_exit=d(JoomlaCalLocale.exit,"",999,"button","","js-btn btn btn-exit",{type:"button","data-action":"exit"}),this.wrapper.querySelector('[data-action="exit"]').addEventListener("click",(function(a){a.preventDefault(),e.dateClicked||(e.inputField.value?("gregorian"!==e.params.dateType&&e.inputField.setAttribute("data-local-value",e.inputField.value),void 0===e.dateClicked?e.inputField.setAttribute("data-alt-value",Date.parseFieldDate(e.inputField.value,e.params.dateFormat,e.params.dateType).print(e.params.dateFormat,"gregorian",!1)):e.inputField.setAttribute("data-alt-value",e.date.print(e.params.dateFormat,"gregorian",!1))):e.inputField.setAttribute("data-alt-value","0000-00-00 00:00:00"),e.date=Date.parseFieldDate(e.inputField.getAttribute("data-alt-value"),e.params.dateFormat,e.params.dateType)),e.close()})),this.processCalendar()},t.prototype.processCalendar=function(){this.table.style.visibility="hidden";var e=this.params.firstDayOfWeek,a=this.date,t=new Date,s=t.getLocalFullYear(this.params.dateType),l=t.getLocalMonth(this.params.dateType),r=t.getLocalDate(this.params.dateType),o=a.getOtherFullYear(this.params.dateType),i=a.getHours(),n=a.getMinutes(),d=(a.getSeconds(),!this.params.time24);o<this.params.minYear?(o=this.params.minYear,a.setOtherFullYear(this.params.dateType,o)):o>this.params.maxYear&&(o=this.params.maxYear,a.setOtherFullYear(this.params.dateType,o)),this.params.firstDayOfWeek=e,this.date=new Date(a);var m=a.getLocalMonth(this.params.dateType),p=a.getLocalDate(this.params.dateType);a.setLocalDate(this.params.dateType,1);var c=(a.getLocalDay(this.params.dateType)-this.params.firstDayOfWeek)%7;c<0&&(c+=7),a.setLocalDate(this.params.dateType,-c),a.setLocalDate(this.params.dateType,a.getLocalDate(this.params.dateType)+1);for(var u=this.tbody.firstChild,h=this.ar_days=new Array,y=JoomlaCalLocale.weekend,v=parseInt(a.getLocalWeekDays(this.params.dateType)),g=0;g<v;++g,u=u.nextSibling){var b=u.firstChild;this.params.weekNumbers&&(b.className="day wn",b.innerHTML=Joomla.sanitizeHtml(a.getLocalWeekNumber(this.params.dateType)),b=b.nextSibling),u.className=this.params.weekNumbers?"daysrow wk":"daysrow";for(var L,f=!1,C=h[g]=[],w=v+1,T=0;T<w;++T,b=b.nextSibling,a.setLocalDate(this.params.dateType,L+1)){b.className="day",b.style.textAlign="center",L=a.getLocalDate(this.params.dateType);var N=a.getLocalDay(this.params.dateType);b.pos=g<<4|T,C[T]=b;var D=a.getLocalMonth(this.params.dateType)===m;if(D)b.otherMonth=!1,f=!0,b.style.cursor="pointer";else{if(!this.params.showsOthers){b.className+=" emptycell",b.innerHTML="&#160;",b.disabled=!0;continue}b.className+=" disabled othermonth ",b.otherMonth=!0}b.disabled=!1,b.innerHTML=this.params.debug?Joomla.sanitizeHtml(L):Joomla.sanitizeHtml(Date.convertNumbers(L)),b.disabled||(b.caldate=new Date(a),D&&L===p&&(b.className+=" selected",this.currentDateEl=b),a.getLocalFullYear(this.params.dateType)===s&&a.getLocalMonth(this.params.dateType)===l&&L===r&&(b.className+=" today"),-1!==y.indexOf(N)&&(b.className+=" weekend"))}f||this.params.showsOthers?u.classList.remove("hidden"):(u.classList.add("hidden"),u.className="emptyrow")}if(this.params.showsTime){i>12&&d&&(i-=12),i=i<10?"0"+i:i,n=n<10?"0"+n:n;var F=this.table.querySelector(".time-hours"),J=this.table.querySelector(".time-minutes");if(this.resetSelected(F),this.params.time24?F.value=i:F.value="00"==i?"12":i,this.resetSelected(J),J.value=n,!this.params.time24){var k=new Date(this.inputField.getAttribute("data-alt-value")),A=this.table.querySelector(".time-ampm");k.getHours()>12&&(this.resetSelected(A),A.value="pm")}}if(this.params.compressedHeader){var M=Date.convertNumbers(o.toString());this._nav_month.getElementsByTagName("span")[0].innerHTML=this.params.monthBefore?M+" - "+JoomlaCalLocale.months[m]:JoomlaCalLocale.months[m]+" - "+M}else this._nav_month.getElementsByTagName("span")[0].innerHTML=this.params.debug?m+" "+JoomlaCalLocale.months[m]:JoomlaCalLocale.months[m],this.title.getElementsByTagName("span")[0].innerHTML=this.params.debug?o+" "+Date.convertNumbers(o.toString()):Date.convertNumbers(o.toString());this.table.style.visibility="visible"},t.prototype._bindEvents=function(){var e=this;this.inputField.addEventListener("blur",(function(a){var s=t.getCalObject(this)._joomlaCalendar;if(s.dropdownElement.classList.contains("hidden")){if(s){if(s.inputField.value)if(void 0===s.params.dateClicked)if(s.inputField.setAttribute("data-local-value",s.inputField.value),"gregorian"!==s.params.dateType){var l,r=Date.parseFieldDate(s.inputField.value,s.params.dateFormat,s.params.dateType);l=Date.localCalToGregorian(r.getFullYear(),r.getMonth(),r.getDate()),r.setFullYear(l[0]),r.setMonth(l[1]),r.setDate(l[2]),s.inputField.setAttribute("data-alt-value",r.print(s.params.dateFormat,"gregorian",!1))}else s.inputField.setAttribute("data-alt-value",Date.parseFieldDate(s.inputField.value,s.params.dateFormat,s.params.dateType).print(s.params.dateFormat,"gregorian",!1));else s.inputField.setAttribute("data-alt-value",s.date.print(s.params.dateFormat,"gregorian",!1));else s.inputField.setAttribute("data-alt-value","0000-00-00 00:00:00");s.date=Date.parseFieldDate(s.inputField.getAttribute("data-alt-value"),s.params.dateFormat,s.params.dateType)}e.close()}else a.preventDefault()}),!0),this.button.addEventListener("click",(function(){e.show()}),!1)};var s=function(a){return a||(a=e.event),a.preventDefault(),a.stopPropagation(),!1},l=function(e,t){var s;return s=a.createElement(e),void 0!==t&&t.appendChild(s),s},r=function(e){return!isNaN(e)&&(0|(a=parseFloat(e)))===a;var a},o=function(e,a){return(new Date).getLocalFullYear(a)+e};function i(e){for(var a=e.target.querySelectorAll(".field-calendar"),s=0,l=a.length;s<l;s++)t.init(a[s])}t.getCalObject=function(e){if(!e)return!1;for(;e.parentNode;)if((e=e.parentNode).classList.contains("field-calendar"))return e;return!1},t.prototype.setAltValue=function(){var e=this.inputField;e.getAttribute("disabled")||(e.value=e.getAttribute("data-alt-value")&&"0000-00-00 00:00:00"!==e.getAttribute("data-alt-value")?e.getAttribute("data-alt-value"):"")},t.onSubmit=function(){if(Joomla=e.Joomla||{},!Joomla.calendarProcessed){Joomla.calendarProcessed=!0;for(var t=a.querySelectorAll(".field-calendar"),s=0;s<t.length;s++){var l=t[s]._joomlaCalendar;l&&l.setAltValue()}}},t.init=function(a,s){e.JoomlaCalLocale=e.JoomlaCalLocale?JoomlaCalLocale:{},JoomlaCalLocale.today=JoomlaCalLocale.today?JoomlaCalLocale.today:"today",JoomlaCalLocale.weekend=JoomlaCalLocale.weekend?JoomlaCalLocale.weekend:[0,6],JoomlaCalLocale.localLangNumbers=JoomlaCalLocale.localLangNumbers?JoomlaCalLocale.localLangNumbers:[0,1,2,3,4,5,6,7,8,9],JoomlaCalLocale.wk=JoomlaCalLocale.wk?JoomlaCalLocale.wk:"wk",JoomlaCalLocale.AM=JoomlaCalLocale.AM?JoomlaCalLocale.AM:"AM",JoomlaCalLocale.PM=JoomlaCalLocale.PM?JoomlaCalLocale.PM:"PM",JoomlaCalLocale.am=JoomlaCalLocale.am?JoomlaCalLocale.am:"am",JoomlaCalLocale.pm=JoomlaCalLocale.pm?JoomlaCalLocale.pm:"pm",JoomlaCalLocale.dateType=JoomlaCalLocale.dateType?JoomlaCalLocale.dateType:"gregorian",JoomlaCalLocale.time=JoomlaCalLocale.time?JoomlaCalLocale.time:"time",JoomlaCalLocale.days=JoomlaCalLocale.days?JoomlaCalLocale.days:'["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]',JoomlaCalLocale.shortDays=JoomlaCalLocale.shortDays?JoomlaCalLocale.shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],JoomlaCalLocale.months=JoomlaCalLocale.months?JoomlaCalLocale.months:["January","February","March","April","May","June","July","August","September","October","November","December"],JoomlaCalLocale.shortMonths=JoomlaCalLocale.shortMonths?JoomlaCalLocale.shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],JoomlaCalLocale.minYear=JoomlaCalLocale.minYear?JoomlaCalLocale.minYear:1900,JoomlaCalLocale.maxYear=JoomlaCalLocale.maxYear?JoomlaCalLocale.maxYear:2100,JoomlaCalLocale.exit=JoomlaCalLocale.exit?JoomlaCalLocale.exit:"Cancel",JoomlaCalLocale.clear=JoomlaCalLocale.clear?JoomlaCalLocale.clear:"Clear";var l=a._joomlaCalendar;l?l.recreate():new t(a),a&&a.getElementsByTagName("input")[0]&&a.getElementsByTagName("input")[0].form&&!a.getElementsByTagName("input")[0].disabled&&a.getElementsByTagName("input")[0].form.addEventListener("submit",t.onSubmit)},e.JoomlaCalendar=t,a.addEventListener("DOMContentLoaded",i),a.addEventListener("joomla:updated",i),e.Calendar={},Calendar.setup=function(e){if(e.inputField&&a.getElementById(e.inputField)){var s=a.getElementById(e.inputField),l=s.parentNode.querySelectorAll("button")[0];for(var r in e)if(e.hasOwnProperty(r))switch(r){case"ifFormat":l&&l.setAttribute("data-dayformat",e.ifFormat);break;case"firstDay":l&&l.setAttribute("data-firstday",parseInt(e.firstDay));break;case"weekNumbers":l&&l.setAttribute("data-week-numbers","true"===e.weekNumbers||!0===e.weekNumbers?"1":"0");break;case"showOthers":l&&l.setAttribute("data-show-others","true"===e.showOthers||!0===e.showOthers?"1":"0");break;case"showsTime":l&&l.setAttribute("data-show-time","true"===e.showsTime||!0===e.showsTime?"1":"0");break;case"timeFormat":l&&l.setAttribute("data-time-24",parseInt(e.timeFormat))}t.init(s.parentNode.parentNode)}return null}}(window,document);

The same content is in 3 releases, Joomla 4.0.0-rc2 to 4.0.0-rc4. See them all, or every version of this file.