Your IP : 216.73.216.201


Current Path : /home/sunflowe/www/media/system/js/fields/
Upload File :
Current File : /home/sunflowe/www/media/system/js/fields/calendar.min.js

!function(s,i){"use strict";Date.convertNumbers=function(e){var e=e.toString();if(Object.prototype.toString.call(JoomlaCalLocale.localLangNumbers)==="[object Array]"){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();var a=[0,1,2,3,4,5,6,7,8,9];for(var t=0;t<10;t++){e=e.replace(new RegExp(a[t],"g"),t)}return e};var l=function(e){if(!e){throw new Error("Calendar setup failed:\n  No valid element found, Please check your code")}if(typeof Date.parseFieldDate!=="function"){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")}e._joomlaCalendar=this;this.writable=true;this.hidden=true;this.params={};this.element=e;this.inputField=e.getElementsByTagName("input")[0];this.button=e.getElementsByTagName("button")[0];if(!this.inputField){throw new Error("Calendar setup failed:\n  No valid input found, Please check your code")}this.params={debug:false,clicked:false,element:{style:{display:"none"}},writable:true};var a=this,t=this.button,r={inputField:this.inputField,dateType:JoomlaCalLocale.dateType?JoomlaCalLocale.dateType:"gregorian",direction:i.dir!==undefined?i.dir:i.getElementsByTagName("html")[0].getAttribute("dir"),firstDayOfWeek:t.getAttribute("data-firstday")?parseInt(t.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:t.getAttribute("data-min-year"),maxYearTmp:t.getAttribute("data-max-year"),weekendTmp:t.getAttribute("data-weekend"),time24:true,showsOthers:parseInt(t.getAttribute("data-show-others"))===1?true:false,showsTime:true,weekNumbers:parseInt(t.getAttribute("data-week-numbers"))===1?true:false,showsTodayBtn:true,compressedHeader:parseInt(t.getAttribute("data-only-months-nav"))===1?true:false};if(t.getAttribute("data-dayformat")){r.dateFormat=t.getAttribute("data-dayformat")?t.getAttribute("data-dayformat"):"%Y-%m-%d %H:%M:%S"}if(t.getAttribute("data-time-24")){r.time24=parseInt(t.getAttribute("data-time-24"))===24?true:false}if(t.getAttribute("data-show-time")){r.showsTime=parseInt(t.getAttribute("data-show-time"))===1?true:false}if(t.getAttribute("data-today-btn")){r.showsTodayBtn=parseInt(t.getAttribute("data-today-btn"))===1?true:false}for(var s in r){this.params[s]=r[s]}if(o(a.params.minYearTmp)){a.params.minYear=d(parseInt(a.params.minYearTmp),a.params.dateType)}if(o(a.params.maxYearTmp)){a.params.maxYear=d(parseInt(a.params.maxYearTmp),a.params.dateType)}if(a.params.weekendTmp!=="undefined"){a.params.weekend=a.params.weekendTmp.split(",").map(function(e){return parseInt(e,10)})}this._dayMouseDown=function(e){return a._handleDayMouseDown(e)};this._calKeyEvent=function(e){return a._handleCalKeyEvent(e)};this._documentClick=function(e){return a._handleDocumentClick(e)};this.checkInputs();if(this.inputField.getAttribute("readonly")){return}this._create();this._bindEvents()};l.prototype.checkInputs=function(){var e=Date.parseFieldDate(this.inputField.getAttribute("data-alt-value"),this.params.dateFormat,"gregorian");if(this.inputField.value!==""){this.date=e;this.inputField.value=e.print(this.params.dateFormat,this.params.dateType,true)}else{this.date=new Date}};l.prototype.recreate=function(){var e=this.element,a=e.querySelector(".js-calendar");if(a){e._joomlaCalendar=null;a.parentNode.removeChild(a);new l(e)}};l.prototype.updateTime=function(e,a,t){var r=this,s=r.date;var i=r.date.getLocalDate(r.params.dateType),l=r.date.getLocalMonth(r.params.dateType),o=r.date.getLocalFullYear(r.params.dateType),n=this.inputField.parentNode.parentNode.querySelectorAll(".time-ampm")[0];if(!r.params.time24){if(/pm/i.test(n.value)&&e<12){e=parseInt(e)+12}else if(/am/i.test(n.value)&&e==12){e=0}}s.setHours(e);s.setMinutes(parseInt(a,10));s.setSeconds(s.getSeconds());s.setLocalFullYear(r.params.dateType,o);s.setLocalMonth(r.params.dateType,l);s.setLocalDate(r.params.dateType,i);r.dateClicked=false;this.callHandler()};l.prototype.setDate=function(e){if(!e.equalsTo(this.date)){this.date=e;this.processCalendar(this.params.firstDayOfWeek,e)}};l.prototype.moveCursorBy=function(e){var a=new Date(this.date);a.setDate(a.getDate()-e);this.setDate(a)};l.prototype.resetSelected=function(e){var a=e.options;var t=a.length;while(t--){var r=a[t];if(r.selected){r.selected=false}}};l.prototype.callHandler=function(){this.inputField.setAttribute("data-alt-value",this.date.print(this.params.dateFormat,"gregorian",false));if(this.inputField.getAttribute("data-alt-value")&&this.inputField.getAttribute("data-alt-value")!=="0000-00-00 00:00:00"){this.inputField.value=this.date.print(this.params.dateFormat,this.params.dateType,true);if(this.params.dateType!=="gregorian"){this.inputField.setAttribute("data-local-value",this.date.print(this.params.dateFormat,this.params.dateType,true))}}this.inputField.value=this.date.print(this.params.dateFormat,this.params.dateType,true);if(typeof this.inputField.onchange=="function"){this.inputField.onchange()}if(this.dateClicked&&typeof this.params.onUpdate==="function"){this.params.onUpdate(this)}this.inputField.dispatchEvent(new Event("change",{bubbles:true,cancelable:true}));if(this.dateClicked){this.close()}else{this.processCalendar()}};l.prototype.close=function(){this.hide()};l.prototype.show=function(){if(navigator.appName.indexOf("Internet Explorer")!==-1){var e=navigator.appVersion.indexOf("MSIE 9")===-1&&navigator.appVersion.indexOf("MSIE 1")===-1;if(e){if(s.jQuery&&jQuery().chosen){var a=this.element.getElementsByTagName("select");for(var t=0;t<a.length;t++){jQuery(a[t]).chosen("destroy")}}}}this.checkInputs();this.inputField.focus();this.dropdownElement.style.display="block";this.hidden=false;i.addEventListener("keydown",this._calKeyEvent,true);i.addEventListener("keypress",this._calKeyEvent,true);i.addEventListener("mousedown",this._documentClick,true);var r=this.element.querySelector(".js-calendar");if(s.innerHeight<r.getBoundingClientRect().bottom+20){r.style.marginTop=-(r.getBoundingClientRect().height+this.inputField.getBoundingClientRect().height)+"px"}this.processCalendar()};l.prototype.hide=function(){i.removeEventListener("keydown",this._calKeyEvent,true);i.removeEventListener("keypress",this._calKeyEvent,true);i.removeEventListener("mousedown",this._documentClick,true);this.dropdownElement.style.display="none";this.hidden=true};l.prototype._handleDocumentClick=function(e){var a=e.target;if(a!==null&&!a.classList.contains("time")){for(;a!==null&&a!==this.element;a=a.parentNode);}if(a===null){i.activeElement.blur();this.hide();return n(e)}};l.prototype._handleDayMouseDown=function(e){var a=this,t=e.currentTarget,r=e.target||e.srcElement;if(r&&r.hasAttribute("data-action")){return}if(t.nodeName!=="TD"){var s=t.getParent("TD");if(s.nodeName==="TD"){t=s}else{t=t.getParent("TD");if(t.classList.contains("js-calendar")){t=t.getElementsByTagName("table")[0]}}}else{if(!r.classList.contains("js-btn")&&!t.classList.contains("day")&&!t.classList.contains("title")){return}}if(!t||t.disabled){return false}if(typeof t.navtype==="undefined"||t.navtype!==300){if(t.navtype===50){t._current=t.innerHTML}if(r===t||r.parentNode===t){a.cellClick(t,e)}var i=null;if(typeof t.month!=="undefined"){i=t}if(typeof t.parentNode.month!=="undefined"){i=t.parentNode}var l=null;if(i){l=new Date(a.date);if(i.month!==l.getLocalMonth(a.params.dateType)){l.setLocalMonth(a.params.dateType,i.month);a.setDate(l);a.dateClicked=false;this.callHandler()}}else{var o=null;if(typeof t.year!=="undefined"){o=r}if(typeof t.parentNode.year!=="undefined"){o=r.parentNode}if(o){l=new Date(a.date);if(o.year!==l.getLocalFullYear(a.params.dateType)){l.setFullYear(a.params.dateType,o.year);a.setDate(l);a.dateClicked=false;this.callHandler()}}}}return n(e)};l.prototype.cellClick=function(e,a){var t=this,r=false,s=false,i=null;if(typeof e.navtype==="undefined"){if(t.currentDateEl){e.classList.add("selected");t.currentDateEl=e.caldate;r=t.currentDateEl===e.caldate;if(!r){t.currentDateEl=e.caldate}}t.date.setLocalDateOnly("gregorian",e.caldate);var l=!(t.dateClicked=!e.otherMonth);if(t.currentDateEl){s=!e.disabled}if(l){this.processCalendar()}}else{i=new Date(t.date);t.dateClicked=false;var o=i.getOtherFullYear(t.params.dateType),n=i.getLocalMonth(t.params.dateType);switch(e.navtype){case 400:break;case-2:if(!t.params.compressedHeader){if(o>t.params.minYear){i.setOtherFullYear(t.params.dateType,o-1)}}break;case-1:var d=i.getLocalDate(t.params.dateType);if(n>0){var p=i.getLocalMonthDays(t.params.dateType,n-1);if(d>p){i.setLocalDate(t.params.dateType,p)}i.setLocalMonth(t.params.dateType,n-1)}else if(o-- >t.params.minYear){i.setOtherFullYear(t.params.dateType,o);var p=i.getLocalMonthDays(t.params.dateType,11);if(d>p){i.setLocalDate(t.params.dateType,p)}i.setLocalMonth(t.params.dateType,11)}break;case 1:var d=i.getLocalDate(t.params.dateType);if(n<11){var p=i.getLocalMonthDays(t.params.dateType,n+1);if(d>p){i.setLocalDate(t.params.dateType,p)}i.setLocalMonth(t.params.dateType,n+1)}else if(o<t.params.maxYear){i.setOtherFullYear(t.params.dateType,o+1);var p=i.getLocalMonthDays(t.params.dateType,0);if(d>p){i.setLocalDate(t.params.dateType,p)}i.setLocalMonth(t.params.dateType,0)}break;case 2:if(!t.params.compressedHeader)if(o<t.params.maxYear){i.setOtherFullYear(t.params.dateType,o+1)}break;case 0:break}if(!i.equalsTo(t.date)){this.setDate(i);s=true}else if(e.navtype===0){s=r=true}}if(s){if(t.params.showsTime){this.dateClicked=false}a&&this.callHandler()}e.classList.remove("hilite");if(r&&!t.params.showsTime){t.dateClicked=false;a&&this.close()}};l.prototype._handleCalKeyEvent=function(e){var a=this,t=e.keyCode;if(e.target===this.inputField&&(t===13||t===9)){this.close()}if(a.params.direction==="rtl"){if(t===37){t=39}else if(t===39){t=37}}if(t===32){if(e.shiftKey){e.preventDefault();this.cellClick(a._nav_now,e);a.close()}}if(t===27){this.close()}if(t===38){this.moveCursorBy(7)}if(t===40){this.moveCursorBy(-7)}if(t===37){this.moveCursorBy(1)}if(t===39){this.moveCursorBy(-1)}if(e.target===this.inputField&&!(t>48||t<57||t===186||t===189||t===190||t===32)){return n(e)}};l.prototype._create=function(){var m=this,e=this.element,a=L("table"),t=L("div");this.table=a;a.className="table";a.cellSpacing=0;a.cellPadding=0;a.style.marginBottom=0;this.dropdownElement=t;e.appendChild(t);if(this.params.direction){t.style.direction=this.params.direction}t.className="js-calendar";t.style.position="absolute";t.style.boxShadow="0px 0px 70px 0px rgba(0,0,0,0.67)";t.style.minWidth=this.inputField.width;t.style.padding="0";t.style.display="none";t.style.left="auto";t.style.top="auto";t.style.zIndex=1060;t.style.borderRadius="20px";this.wrapper=L("div");this.wrapper.className="calendar-container";t.appendChild(this.wrapper);this.wrapper.appendChild(a);var r=L("thead",a);r.className="calendar-header";var c=null,u=null,n=this,s=function(e,a,t,r,s,i,l){r=r?r:"td";s=s?s:{};c=L(r,u);if(a){i=i?'class="'+i+'"':"";c.colSpan=a}for(var o in s){c.style[o]=s[o]}for(var o in l){c.setAttribute(o,l[o])}if(t!==0&&Math.abs(t)<=2){c.className+=" nav"}if(a){c.addEventListener("mousedown",m._dayMouseDown,true)}c.calendar=n;c.navtype=t;if(t!==0&&Math.abs(t)<=2){c.innerHTML="<a "+i+" style='display:inline;padding:2px 6px;cursor:pointer;text-decoration:none;' unselectable='on'>"+e+"</a>"}else{c.innerHTML=a?"<div unselectable='on'"+i+">"+e+"</div>":e;if(!a&&i){c.className=i}}return c};if(this.params.compressedHeader===false){u=L("tr",r);u.className="calendar-head-row";this._nav_py=s("&lsaquo;",1,-2,"",{"text-align":"center","font-size":"18px","line-height":"18px"},"js-btn btn-prev-year");this.title=s('<div style="text-align:center;font-size:18px"><span></span></div>',this.params.weekNumbers?6:5,300);this.title.className="title";this._nav_ny=s(" &rsaquo;",1,2,"",{"text-align":"center","font-size":"18px","line-height":"18px"},"js-btn btn-next-year")}u=L("tr",r);u.className="calendar-head-row";this._nav_pm=s("&lsaquo;",1,-1,"",{"text-align":"center","font-size":"2em","line-height":"1em"},"js-btn btn-prev-month");this._nav_month=s('<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=s(" &rsaquo;",1,1,"",{"text-align":"center","font-size":"2em","line-height":"1em"},"js-btn btn-next-month");u=L("tr",r);u.className=m.params.weekNumbers?"daynames wk":"daynames";if(this.params.weekNumbers){c=L("td",u);c.className="day-name wn";c.innerHTML=JoomlaCalLocale.wk}for(var i=7;i>0;--i){c=L("td",u);if(!i){c.calendar=m}}this.firstdayname=this.params.weekNumbers?u.firstChild.nextSibling:u.firstChild;var l=this.params.firstDayOfWeek,c=this.firstdayname,o=JoomlaCalLocale.weekend;for(var i=0;i<7;++i){var d=(i+l)%7;c.classList.add("day-name");this.params.weekNumbers?c.classList.add("day-name-week"):"";if(i){c.calendar=m;c.fdow=d}if(o.indexOf(o)!==-1){c.classList.add("weekend")}c.innerHTML=JoomlaCalLocale.shortDays[(i+l)%7];c=c.nextSibling}var p=L("tbody",a);this.tbody=p;for(i=6;i>0;--i){u=L("tr",p);if(this.params.weekNumbers){c=L("td",u)}for(var h=7;h>0;--h){c=L("td",u);c.calendar=this;c.addEventListener("mousedown",this._dayMouseDown,true)}}if(this.params.showsTime){u=L("tr",p);u.className="time";c=L("td",u);c.className="time time-title";c.colSpan=1;c.style.verticalAlign="middle";c.innerHTML=" ";var f=L("td",u);f.className="time hours-select";f.colSpan=2;var y=L("td",u);y.className="time minutes-select";y.colSpan=2;(function(){function e(e,a,t,r,s){var i=L("select",s),l;i.calendar=m;i.className=e;i.setAttribute("data-chosen",true);i.style.width="100%";i.navtype=50;i._range=[];for(var o=t;o<=r;++o){var n,d="";if(o===a){d=true}if(o<10&&r>=10){l="0"+o;n=Date.convertNumbers("0")+Date.convertNumbers(o)}else{l=""+o;n=""+Date.convertNumbers(o)}i.options.add(new Option(n,l,d,d))}return i}var a=m.date.getHours(),t=m.date.getMinutes(),r=!m.params.time24,s=m.date.getHours()>12;if(r&&s){a-=12}var i=e("time time-hours",a,r?1:0,r?12:23,f),l=e("time time-minutes",t,0,59,y),o=null;c=L("td",u);c.className="time ampm-select";c.colSpan=m.params.weekNumbers?1:2;if(r){var n=true,d=Date.parseFieldDate(m.inputField.getAttribute("data-alt-value"),m.params.dateFormat,"gregorian");s=d.getHours()>=12;var p=L("select",c);p.className="time-ampm";p.style.width="100%";p.options.add(new Option(JoomlaCalLocale.PM,"pm",s?n:"",s?n:""));p.options.add(new Option(JoomlaCalLocale.AM,"am",s?"":n,s?"":n));o=p;o.addEventListener("change",function(e){m.updateTime(e.target.parentNode.parentNode.childNodes[1].childNodes[0].value,e.target.parentNode.parentNode.childNodes[2].childNodes[0].value,e.target.parentNode.parentNode.childNodes[3].childNodes[0].value)},false)}else{c.innerHTML="&#160;";c.colSpan=m.params.weekNumbers?3:2}i.addEventListener("change",function(e){m.updateTime(e.target.parentNode.parentNode.childNodes[1].childNodes[0].value,e.target.parentNode.parentNode.childNodes[2].childNodes[0].value,e.target.parentNode.parentNode.childNodes[3].childNodes[0].value)},false);l.addEventListener("change",function(e){m.updateTime(e.target.parentNode.parentNode.childNodes[1].childNodes[0].value,e.target.parentNode.parentNode.childNodes[2].childNodes[0].value,e.target.parentNode.parentNode.childNodes[3].childNodes[0].value)},false)})()}u=L("div",this.wrapper);u.className="buttons-wrapper btn-group";this._nav_clear=s(JoomlaCalLocale.clear,"",100,"button","","js-btn btn btn-clear",{type:"button","data-action":"clear"});var v=u.querySelector('[data-action="clear"]');v.addEventListener("click",function(e){e.preventDefault();var a=m.table.querySelectorAll("td");for(var t=0;t<a.length;t++){if(a[t].classList.contains("selected")){a[t].classList.remove("selected");break}}m.inputField.setAttribute("data-alt-value","0000-00-00 00:00:00");m.inputField.setAttribute("value","");m.inputField.value="";if(m.inputField.onchange){m.inputField.onchange()}m.inputField.dispatchEvent(new Event("change",{bubbles:true,cancelable:true}))});if(this.params.showsTodayBtn){this._nav_now=s(JoomlaCalLocale.today,"",0,"button","","js-btn btn btn-today",{type:"button","data-action":"today"});var g=this.wrapper.querySelector('[data-action="today"]');g.addEventListener("click",function(e){e.preventDefault();m.date.setLocalDateOnly("gregorian",new Date);m.dateClicked=true;m.callHandler();m.close()})}this._nav_exit=s(JoomlaCalLocale.exit,"",999,"button","","js-btn btn btn-exit",{type:"button","data-action":"exit"});var b=this.wrapper.querySelector('[data-action="exit"]');b.addEventListener("click",function(e){e.preventDefault();if(!m.dateClicked){if(m.inputField.value){if(m.params.dateType!=="gregorian"){m.inputField.setAttribute("data-local-value",m.inputField.value)}if(typeof m.dateClicked==="undefined"){m.inputField.setAttribute("data-alt-value",Date.parseFieldDate(m.inputField.value,m.params.dateFormat,m.params.dateType).print(m.params.dateFormat,"gregorian",false))}else{m.inputField.setAttribute("data-alt-value",m.date.print(m.params.dateFormat,"gregorian",false))}}else{m.inputField.setAttribute("data-alt-value","0000-00-00 00:00:00")}m.date=Date.parseFieldDate(m.inputField.getAttribute("data-alt-value"),m.params.dateFormat,m.params.dateType)}m.close()});this.processCalendar()};l.prototype.processCalendar=function(){this.table.style.visibility="hidden";var e=this.params.firstDayOfWeek,a=this.date,t=new Date,r=t.getLocalFullYear(this.params.dateType),s=t.getLocalMonth(this.params.dateType),i=t.getLocalDate(this.params.dateType),l=a.getOtherFullYear(this.params.dateType),o=a.getHours(),n=a.getMinutes(),d=a.getSeconds(),p=!this.params.time24;if(l<this.params.minYear){l=this.params.minYear;a.setOtherFullYear(this.params.dateType,l)}else if(l>this.params.maxYear){l=this.params.maxYear;a.setOtherFullYear(this.params.dateType,l)}this.params.firstDayOfWeek=e;this.date=new Date(a);var m=a.getLocalMonth(this.params.dateType);var c=a.getLocalDate(this.params.dateType);a.setLocalDate(this.params.dateType,1);var u=(a.getLocalDay(this.params.dateType)-this.params.firstDayOfWeek)%7;if(u<0){u+=7}a.setLocalDate(this.params.dateType,-u);a.setLocalDate(this.params.dateType,a.getLocalDate(this.params.dateType)+1);var h=this.tbody.firstChild,f=this.ar_days=new Array,y=JoomlaCalLocale.weekend,v=parseInt(a.getLocalWeekDays(this.params.dateType));for(var g=0;g<v;++g,h=h.nextSibling){var b=h.firstChild;if(this.params.weekNumbers){b.className="day wn";b.innerHTML=a.getLocalWeekNumber(this.params.dateType);b=b.nextSibling}h.className=this.params.weekNumbers?"daysrow wk":"daysrow";var L=false,C,w=f[g]=[],T=v+1;for(var N=0;N<T;++N,b=b.nextSibling,a.setLocalDate(this.params.dateType,C+1)){b.className="day";b.style["textAlign"]="center";C=a.getLocalDate(this.params.dateType);var F=a.getLocalDay(this.params.dateType);b.pos=g<<4|N;w[N]=b;var D=a.getLocalMonth(this.params.dateType)===m;if(!D){if(this.params.showsOthers){b.className+=" disabled othermonth ";b.otherMonth=true}else{b.className+=" emptycell";b.innerHTML="&#160;";b.disabled=true;continue}}else{b.otherMonth=false;L=true;b.style.cursor="pointer"}b.disabled=false;b.innerHTML=this.params.debug?C:Date.convertNumbers(C);if(!b.disabled){b.caldate=new Date(a);if(D&&C===c){b.className+=" selected";this.currentDateEl=b}if(a.getLocalFullYear(this.params.dateType)===r&&a.getLocalMonth(this.params.dateType)===s&&C===i){b.className+=" today"}if(y.indexOf(F)!==-1)b.className+=" weekend"}}if(!(L||this.params.showsOthers)){h.style.display="none";h.className="emptyrow"}else{h.style.display=""}}if(this.params.showsTime){if(o>12&&p){o-=12}o=o<10?"0"+o:o;n=n<10?"0"+n:n;var k=this.table.querySelector(".time-hours"),J=this.table.querySelector(".time-minutes");this.resetSelected(k);if(!this.params.time24){k.value=o=="00"?"12":o}else{k.value=o}this.resetSelected(J);J.value=n;if(!this.params.time24){var A=new Date(this.inputField.getAttribute("data-alt-value")),M=this.table.querySelector(".time-ampm"),E=A.getHours();if(E>12){this.resetSelected(M);M.value="pm"}}}if(!this.params.compressedHeader){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?l+" "+Date.convertNumbers(l.toString()):Date.convertNumbers(l.toString())}else{var x=Date.convertNumbers(l.toString());this._nav_month.getElementsByTagName("span")[0].innerHTML=!this.params.monthBefore?JoomlaCalLocale.months[m]+" - "+x:x+" - "+JoomlaCalLocale.months[m]}this.table.style.visibility="visible"};l.prototype._bindEvents=function(){var s=this;this.inputField.addEventListener("blur",function(e){var a=l.getCalObject(this)._joomlaCalendar;if(a.dropdownElement.style.display==="block"){e.preventDefault();return}if(a){if(a.inputField.value){if(typeof a.params.dateClicked==="undefined"){a.inputField.setAttribute("data-local-value",a.inputField.value);if(a.params.dateType!=="gregorian"){var t,r=Date.parseFieldDate(a.inputField.value,a.params.dateFormat,a.params.dateType);t=Date.localCalToGregorian(r.getFullYear(),r.getMonth(),r.getDate());r.setFullYear(t[0]);r.setMonth(t[1]);r.setDate(t[2]);a.inputField.setAttribute("data-alt-value",r.print(a.params.dateFormat,"gregorian",false))}else{a.inputField.setAttribute("data-alt-value",Date.parseFieldDate(a.inputField.value,a.params.dateFormat,a.params.dateType).print(a.params.dateFormat,"gregorian",false))}}else{a.inputField.setAttribute("data-alt-value",a.date.print(a.params.dateFormat,"gregorian",false))}}else{a.inputField.setAttribute("data-alt-value","0000-00-00 00:00:00")}a.date=Date.parseFieldDate(a.inputField.getAttribute("data-alt-value"),a.params.dateFormat,a.params.dateType)}s.close()},true);this.button.addEventListener("click",function(){s.show()},false)};var n=function(e){e||(e=s.event);e.preventDefault();e.stopPropagation();return false};var L=function(e,a){var t=null;t=i.createElement(e);if(typeof a!=="undefined"){a.appendChild(t)}return t};var o=function(e){return!isNaN(e)&&function(e){return(e|0)===e}(parseFloat(e))};var d=function(e,a){var t=new Date;var r=t.getLocalFullYear(a);return r+e};if(!Array.prototype.indexOf){Array.prototype.indexOf=function(e){var a=this.length>>>0,t=Number(arguments[1])||0;t=t<0?Math.ceil(t):Math.floor(t);if(t<0){t+=a}for(;t<a;t++){if(t in this&&this[t]===e){return t}}return-1}}l.getCalObject=function(e){if(!e){return false}while(e.parentNode){e=e.parentNode;if(e.classList.contains("field-calendar")){return e}}return false};l.prototype.setAltValue=function(){var e=this.inputField;if(e.getAttribute("disabled"))return;e.value=e.getAttribute("data-alt-value")?e.getAttribute("data-alt-value"):""};l.onSubmit=function(){Joomla=s.Joomla||{};if(!Joomla.calendarProcessed){Joomla.calendarProcessed=true;var e=i.querySelectorAll(".field-calendar");for(var a=0;a<e.length;a++){var t=e[a],r=t._joomlaCalendar;if(r){r.setAltValue()}}}};l.init=function(e,a){s.JoomlaCalLocale=s.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 t=e._joomlaCalendar;if(!t){new l(e)}else{t.recreate()}if(e&&e.getElementsByTagName("input")[0]&&e.getElementsByTagName("input")[0].form&&!e.getElementsByTagName("input")[0].disabled){e.getElementsByTagName("input")[0].form.addEventListener("submit",l.onSubmit)}};s.JoomlaCalendar=l;i.addEventListener("DOMContentLoaded",function(){var t,r;t=i.querySelectorAll(".field-calendar");for(r=0;r<t.length;r++){l.init(t[r])}s.jQuery&&jQuery(i).on("subform-row-add",function(e,a){t=a.querySelectorAll(".field-calendar");for(r=0;r<t.length;r++){l.init(t[r])}});s.Calendar={};Calendar.setup=function(e){if(e.inputField&&i.getElementById(e.inputField)){var a=i.getElementById(e.inputField),t=a.parentNode.querySelectorAll("button")[0];for(var r in e){if(e.hasOwnProperty(r)){switch(r){case"ifFormat":if(t)t.setAttribute("data-dayformat",e.ifFormat);break;case"firstDay":if(t)t.setAttribute("data-firstday",parseInt(e.firstDay));break;case"weekNumbers":if(t)t.setAttribute("data-week-numbers",e.weekNumbers==="true"||e.weekNumbers===true?"1":"0");break;case"showOthers":if(t)t.setAttribute("data-show-others",e.showOthers==="true"||e.showOthers===true?"1":"0");break;case"showsTime":if(t)t.setAttribute("data-show-time",e.showsTime==="true"||e.showsTime===true?"1":"0");break;case"timeFormat":if(t)t.setAttribute("data-time-24",parseInt(e.timeFormat));break;case"displayArea":case"inputField":case"button":case"eventName":case"daFormat":case"disableFunc":case"dateStatusFunc":case"dateTooltipFunc":case"dateText":case"align":case"range":case"flat":case"flatCallback":case"onSelect":case"onClose":case"onUpdate":case"date":case"electric":case"step":case"position":case"cache":case"multiple":break}}}l.init(a.parentNode.parentNode)}return null}})}(window,document);