diff --git a/README.md b/README.md index 04ddbc41..65e1ba22 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Calendar.js [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Calendar.js%2C%20a%20free%20JavaScript%20library&url=https://github.com/williamtroup/Calendar.js&hashtags=calendar,javascript,responsive,events)

One of the world's easiest, most powerful, and fully responsive JavaScript Calendars!

-

v2.8.1

+

v2.8.2


What views does Calendar.js support?

diff --git a/dist/calendar.binding.js b/dist/calendar.binding.js index 0680f6d6..e2bf5aa7 100644 --- a/dist/calendar.binding.js +++ b/dist/calendar.binding.js @@ -1,4 +1,4 @@ -/*! Calendar.js v2.8.1 | (c) Bunoon | GNU AGPLv3 License */ +/*! Calendar.js v2.8.2 | (c) Bunoon | GNU AGPLv3 License */ (function(documentObject) { var _attribute_Name = "data-binding-calendar"; documentObject.addEventListener("DOMContentLoaded", function() { diff --git a/dist/calendar.binding.min.js b/dist/calendar.binding.min.js index 0845fa24..bf96c7ed 100644 --- a/dist/calendar.binding.min.js +++ b/dist/calendar.binding.min.js @@ -1,3 +1,3 @@ -/*! Calendar.js v2.8.1 | (c) Bunoon | GNU AGPLv3 License */ +/*! Calendar.js v2.8.2 | (c) Bunoon | GNU AGPLv3 License */ (function(f){function g(a){var c=[];a=f.getElementsByTagName(a);for(var d=a.length,b=0;bf){e=1;b=new Date(y);b.setMonth(b.getMonth()+1);for(f+=1;43>f;f++)g=1===e,Dh(e,f,b.getMonth(),b.getFullYear(),!0,g),e++;e=Pc(b.getFullYear(),b.getMonth());e=Math.round(e/2);Eh=new Date(b.getFullYear(),b.getMonth(),e)}else Eh=null;Ga();a&&(cj(),dj(),ej(),fj(),gj(),Ql(),Rl(),Sl(),hj(),t||(Tl(),Ul(),Vl(),Wl()),null!==Ub||t||(Ub=h("div","calendar-notification"),Ha.push(Ub),D.body.appendChild(Ub))); -d&&Ta(!0,!1);null!==G&&(Fh.innerText=Gh(c.monthTitleBarDateFormat,y))}}function ij(){va(c.events)&&ka.addEvents(c.events,!1,!1,!1);if(c.useLocalStorageForEvents&&na.localStorage)for(var a=na.localStorage.length,b=0;be;e++){f=h("div","row-cells days");a.appendChild(f);d||Fe.push(f);for(var g=0;7>g;g++){var k=g;if(c.startOfWeekDay===wa.saturday||c.startOfWeekDay===wa.sunday)k=c.startOfWeekDay+g,7<=k&&(k-=7);if(-1< +function(){Hd(null,!0)}),x(Y,"ib-hourglass",c.viewFullDayTooltipText,function(){qb(null,!0)}));a=h("div","title-container");Y.appendChild(a);Yl(a);Zl(a)}function lj(a,b){var d=q(a);a=d?a:G;b=q(b)?b:"calendar-day-";if(!d&&0e;e++){f=h("div","row-cells days");a.appendChild(f);d||Fe.push(f);for(var g=0;7>g;g++){var k=g;if(c.startOfWeekDay===xa.saturday||c.startOfWeekDay===xa.sunday)k=c.startOfWeekDay+g,7<=k&&(k-=7);if(-1< c.visibleDays.indexOf(k)){k=7*e+(g+1);var l=h("div",Yf(c.allowEventScrollingOnMainDisplay));l.id=b+k;f.appendChild(l);c.allowEventScrollingOnMainDisplay&&(l.className+=" scrollY");0w.never){var f=h("div","ib-refresh-medium ib-no-hover ib-no-active");f.style.borderColor=d.style.color;e.appendChild(f)}e.innerHTML+=Bc(b.title);d.appendChild(e);e=h("div","date");d.appendChild(e);f=h("div","duration");d.appendChild(f);b.from.getDate()===b.to.getDate()?b.isAllDay?Fb(e,b.from,null," - "+c.allDayText):(Fb(e,b.from,null," - "+Kd(b.from,b.to)),z(f,Gb(b.from,b.to))):(Le(e,b.from,b.to),z(f,Gb(b.from,b.to))); f.innerHTML===n.empty&&d.removeChild(f);Ba(b.repeatEvery)&&b.repeatEvery>w.never&&(e=h("div","repeats"),z(e,c.repeatsText.replace(":",n.empty)+n.space+ed(b.repeatEvery)),d.appendChild(e));Ua(b.location)&&(e=h("div","location"),z(e,b.location),d.appendChild(e));Ua(b.description)&&(e=h("div","description"),z(e,b.description),d.appendChild(e));Ya("onEventClick")&&d.addEventListener("click",function(){A("onEventClick",b)});c.manualEditingEnabled?d.ondblclick=function(g){B(g);Z(b)}:Ya("onEventDoubleClick")&& (d.ondblclick=function(){A("onEventDoubleClick",b)});a.scrollHeight>a.clientHeight&&-1===a.className.indexOf(" scroll-margin")&&(a.className+=" scroll-margin")}function Il(a){B(a);R()}function Gl(a){B(a);a=new Date(y);a.setDate(a.getDate()+1);a.getFullYear()<=c.maximumYear&&R(a)}function Hl(a){B(a);a=new Date(y);a.setDate(a.getDate()-1);a.getFullYear()>=c.minimumYear&&R(a)}function pj(){t&&(c.exportEventsEnabled=!1,c.manualEditingEnabled=!1,c.fullScreenModeEnabled=!1,c.eventNotificationsEnabled=!1, -c.showPreviousNextMonthNamesInMainDisplay=!1,c.showExtraToolbarButtons=!1,c.holidays=[])}function Xl(a){B(a);a=D.getElementsByClassName("calendar calendar-shown");a=[].slice.call(a);for(var b=a.length,d=0;da;a++)0===a%3&&(d=h("div","months"),Hb.appendChild(d)),cm(d,a);Ne=h("div","contents custom-scroll-bars");for(Hb.appendChild(Ne);!(dm(b.getFullYear()),fd(b),b.getFullYear()>c.maximumYear););}function cm(a,b){var d=h("div","month-name"),e=c.monthNamesAbbreviated[b]; d.onclick=function(f){B(f);y.getMonth()!==b&&(y.setMonth(b),R(y),eg())};z(d,e);a.appendChild(d);Cc[b.toString()]=d}function dm(a){var b=h("div");b.className="year";b.innerText=a.toString();b.id="year-selected-"+a.toString();Ne.appendChild(b);b.ondblclick=B;b.onclick=function(d){B(d);y.getFullYear()!==a&&(y.setFullYear(a),R(y),eg())}}function bm(a){B(a);if("block"!==Hb.style.display){Fa();Hb.style.display="block";dg.className="ib-arrow-up-full-medium";for(var b in Cc)Cc.hasOwnProperty(b.toString())&& (Cc[b.toString()].className="month-name");a=y.getMonth().toString();b=new Date;y.getFullYear()===b.getFullYear()&&(b=b.getMonth().toString(),Cc.hasOwnProperty(b)&&(Cc[b].className="month-name-current-month"));Cc.hasOwnProperty(a)&&(Cc[a].className="month-name-selected");a=em();Ne.scrollTop=null!==a?a.offsetTop-Ne.offsetTop-c.spacing:0}else eg()}function em(){var a=Hb.getElementsByClassName("year"),b=a.length;if(1<=b)for(var d=0;da;a++)for(var b=0;7>b;b++){var d=Aa("calendar-day-"+(7*a+(b+1)));null!==d&&(Oh(d,"event"),Oh(d,"plus-x-events"))}Ah();Nd=!1;Wc=[];Od={};a=Bb(id());b=a.length;for(d=0;dw.never&&(f===w.everyDay?Zb(e,lb,1):f===w.everyWeek?Zb(e,Jb,1):f===w.every2Weeks?Zb(e,Jb,2):f===w.everyMonth?Zb(e,Rd,1):f===w.everyYear?Zb(e,fd,1):f===w.custom&&(f=I(e.repeatEveryCustomType),g=I(e.repeatEveryCustomValue),0=c.maximumEventsPerDayDisplay||c.useOnlyDotEventsForMainDisplay){e=h("div","event");var k=b.title;e.setAttribute("event-type",I(b.type));e.setAttribute("event-id",b.id);c.showTimesInMainCalendarEvents&&!b.isAllDay&&b.from.getDate()===b.to.getDate()&&(k=Kd(b.from,b.to)+": "+k);if(c.useOnlyDotEventsForMainDisplay)e.className+=" event-circle";else{if(I(b.repeatEvery)>w.never){var l=h("div","ib-refresh-small ib-no-hover ib-no-active");l.style.borderColor=e.style.color;e.appendChild(l)}e.innerHTML+= -Bc(k)}d.appendChild(e);Sh(e,b,a,d);Ke(e,b,cg(b,a),c.applyCssToEventsNotInCurrentMonth);hg(e,b);sa(b.from,a)&&(e.id="day-"+b.id);e.onmousemove=function(r){null!==Pe&&Pe.id===b.id?B(r):Lj(r,b)};e.oncontextmenu=function(r){ig(r,b,f)};e.addEventListener("click",function(r){jg(r,b)});Ya("onEventClick")&&e.addEventListener("click",function(){A("onEventClick",b)});c.manualEditingEnabled?e.ondblclick=function(r){B(r);Z(b,null,null,g)}:Ya("onEventDoubleClick")&&(e.ondblclick=function(){A("onEventDoubleClick", -b)})}else mm(d,a)}function mm(a,b){var d=a.getElementsByClassName("plus-x-events");d=0w.never&&(d=new Date(b),d.setHours(e.getHours(),e.getMinutes()),e=d);return e}function Qh(a){Od.hasOwnProperty(a)||(Od[a]=0);Od[a]++}function Ll(){if(!t){var a=null!==ea;a&&(ea.innerHTML=n.empty);a||(ea=h("div","full-day-view"), -ea.id=Qc(),G.appendChild(ea));a=h("div","title-bar");ea.appendChild(a);c.fullScreenModeEnabled&&(a.ondblclick=hb);Qe=h("div","title");a.appendChild(Qe);x(a,"ib-close",c.closeTooltipText,nm);a.appendChild(h("div","right-divider-line"));c.showExtraToolbarButtons&&c.fullScreenModeEnabled&&(Th=x(a,"ib-arrow-expand-left-right",c.enableFullScreenTooltipText,hb),a.appendChild(h("div","right-divider-line-full-screen-mode")));x(a,"ib-arrow-right-full",c.nextDayTooltipText,Cj);c.manualEditingEnabled&&c.showExtraToolbarButtons&& -x(a,"ib-plus",c.addEventTooltipText,function(){if(c.useTemplateWhenAddingNewEvent){var b=Uc(V,V);Z(b);Vc()}else Oc()});!t&&Fd()&&(x(a,"ib-hamburger",c.showMenuTooltipText,Sc),a.appendChild(h("div","left-divider-line")));x(a,"ib-arrow-left-full",c.previousDayTooltipText,zj);c.showExtraToolbarButtons&&(Nj=x(a,"ib-pin",c.todayTooltipText,Fj),x(a,"ib-refresh",c.refreshTooltipText,function(){Ta(!0,!0)}),v.enabled&&(Oj=x(a,"ib-search",c.searchTooltipText,De)));sb=h("div","contents custom-scroll-bars"); -ea.appendChild(sb);sb.oncontextmenu=function(b){var d=kg(b,ya);Re=O(d[0])+":"+O(d[1]);Pj(b,V,Wb)};Fc=h("div","content-events-all-day");sb.appendChild(Fc);a=h("div","all-day-text");z(a,c.allDayText);Fc.appendChild(a);ya=h("div","contents-events");ya.ondblclick=om;sb.appendChild(ya);Sd=h("div","working-hours");sb.appendChild(Sd);c.manualEditingEnabled&&c.dragAndDropForEventsEnabled&&(ya.ondragover=B,ya.ondragenter=B,ya.ondragleave=B,ya.ondrop=function(b){Qj(b,V,ya)});Rj(ya);Se=h("div","time-arrow"); -ya.appendChild(Se);Se.appendChild(h("div","arrow-left"));Se.appendChild(h("div","line"))}}function $b(a,b,d,e,f){for(var g=new Date(a.from),k=Ec(a.repeatEveryExcludeDays);gw.never){var l=h("div","ib-refresh-medium ib-no-hover ib-no-active"); -l.style.borderColor=k.style.color;e.appendChild(l)}e.innerHTML+=Bc(a.title);k.appendChild(e);if(!a.isAllDay||c.showAllDayEventDetailsInFullDayView)e=h("div","date"),k.appendChild(e),l=h("div","duration"),k.appendChild(l),a.from.getDate()===a.to.getDate()?a.isAllDay?z(e,c.allDayText):(z(e,Kd(a.from,a.to)),z(l,Gb(a.from,a.to))):(Le(e,a.from,a.to),z(l,Gb(a.from,a.to))),l.innerHTML===n.empty&&k.removeChild(l),Ba(a.repeatEvery)&&a.repeatEvery>w.never&&(e=h("div","repeats"),z(e,c.repeatsText.replace(":", -n.empty)+n.space+ed(a.repeatEvery)),k.appendChild(e)),Ua(a.location)&&(e=h("div","location"),z(e,a.location),k.appendChild(e)),Ua(a.description)&&(e=h("div","description"),z(e,a.description),k.appendChild(e));k.addEventListener("click",function(r){jg(r,a)});Ya("onEventClick")&&k.addEventListener("click",function(){A("onEventClick",a)});c.manualEditingEnabled?k.ondblclick=function(r){B(r);Z(a,null,null,g)}:Ya("onEventDoubleClick")&&(k.ondblclick=function(){A("onEventDoubleClick",a)});a.isAllDay||(d= -Tj(sb,ya,b,k,a));Wb.push(a);a.isAllDay||qg.push({eventDetails:a,eventElement:k,height:k.offsetHeight})}return d}function qb(a,b){a=q(a)?a:new Date;b=q(b)?b:!1;var d=qa(new Date);d=-1=d?4*c.spacing:d,sb.scrollTop=f-d):sb.scrollTop=g-sb.offsetHeight/2);1>=Fc.offsetHeight&&(Fc.style.display="none");Db(Oj,0w.never&&(e===w.everyDay?$b(d,b,a,lb,1):e===w.everyWeek?$b(d,b,a,Jb,1):e===w.every2Weeks? -$b(d,b,a,Jb,2):e===w.everyMonth?$b(d,b,a,Rd,1):e===w.everyYear?$b(d,b,a,fd,1):e===w.custom&&(e=I(d.repeatEveryCustomType),f=I(d.repeatEveryCustomValue),0 -c.visibleDays.length)for(var a=qa(V);-1===c.visibleDays.indexOf(a);)V.setDate(V.getDate()-1),a=qa(V);qb(V,!0)}function Cj(){lb(V);if(7>c.visibleDays.length)for(var a=qa(V);-1===c.visibleDays.indexOf(a);)lb(V),a=qa(V);qb(V,!0)}function Fj(){V=new Date;qb(V,!0)}function Ml(){if(!t){var a=null!==la;a&&(la.innerHTML=n.empty);a||(la=h("div","full-week-view"),la.id=Qc(),G.appendChild(la));a=h("div","title-bar");la.appendChild(a);c.fullScreenModeEnabled&&(a.ondblclick=hb);Ma=h("div","title");a.appendChild(Ma); -x(a,"ib-close",c.closeTooltipText,function(){Xb=[];Td(la)});a.appendChild(h("div","right-divider-line"));c.showExtraToolbarButtons&&c.fullScreenModeEnabled&&(Uh=x(a,"ib-arrow-expand-left-right",c.enableFullScreenTooltipText,hb),a.appendChild(h("div","right-divider-line-full-screen-mode")));x(a,"ib-arrow-right-full",c.nextWeekTooltipText,Dj);c.manualEditingEnabled&&c.showExtraToolbarButtons&&x(a,"ib-plus",c.addEventTooltipText,Oc);!t&&Fd()&&(x(a,"ib-hamburger",c.showMenuTooltipText,Sc),a.appendChild(h("div", -"left-divider-line")));x(a,"ib-arrow-left-full",c.previousWeekTooltipText,Aj);c.showExtraToolbarButtons&&(x(a,"ib-pin",c.thisWeekTooltipText,Gj),x(a,"ib-refresh",c.refreshTooltipText,function(){Ta(!0,!0)}),v.enabled&&(Yj=x(a,"ib-search",c.searchTooltipText,De)));jd=h("div","contents custom-scroll-bars");la.appendChild(jd);qm()}}function qm(){var a=h("div","header-days-container");jd.appendChild(a);Te=h("div","row-cells header-days");a.appendChild(Te);kd=h("div","content-events-all-day");jd.appendChild(kd); -Ud=h("div","row-cells days");kd.appendChild(Ud);a=h("div","all-day-text");z(a,c.allDayText);kd.appendChild(a);Vd=h("div","hours");jd.appendChild(Vd);Rj(Vd);Ue=h("div","row-cells days");Vd.appendChild(Ue)}function Vh(a,b,d){for(;a=b&&g<=d){r=Aa("calendar-week-day-"+qa(g));var p=Aa("calendar-week-all-day-"+qa(g));null!==r&&(ak(r,p,a,g),l=!0)}}return l}function ak(a, -b,d,e){var f=!1,g=Ec(d.seriesIgnoreDates),k=new Date(e),l=Pd(k),r=new Date(e);if(Qd(d)&&-1===g.indexOf(l)){var p=h("div","event");e=qa(k);p.setAttribute("event-type",I(d.type));p.setAttribute("event-id",d.id);a.appendChild(p);p.onclick=function(u){Sj(u,p)};p.oncontextmenu=function(u){ig(u,d,l)};d.isAllDay?(b.appendChild(p),Sh(p,d,k,b),Wh=!0):c.manualEditingEnabled&&c.dragAndDropForEventsEnabled&&!We(d)&&(sa(d.from,d.to)&&!d.isAllDay&&(p.className+=" resizable"),p.ondragstart=function(u){var H=lg(p); -mg=p;ng=p.offsetTop;Kb=d;og=H.top-u.pageY;pg=k},p.ondragEnd=Kh,p.setAttribute("draggable",!0));Ke(p,d,cg(d,k));hg(p,d);sa(d.from,k)&&(p.id="week-day-"+d.id);b=h("div","title");I(d.repeatEvery)>w.never&&(f=h("div","ib-refresh-medium ib-no-hover ib-no-active"),f.style.borderColor=p.style.color,b.appendChild(f));b.innerHTML+=Bc(d.title);p.appendChild(b);if(!d.isAllDay||c.showAllDayEventDetailsInFullDayView)b=h("div","date"),p.appendChild(b),f=h("div","duration"),p.appendChild(f),d.from.getDate()===d.to.getDate()? -d.isAllDay?z(b,c.allDayText):(z(b,Kd(d.from,d.to)),z(f,Gb(d.from,d.to))):(Le(b,d.from,d.to),z(f,Gb(d.from,d.to))),f.innerHTML===n.empty&&p.removeChild(f),Ba(d.repeatEvery)&&d.repeatEvery>w.never&&(b=h("div","repeats"),z(b,c.repeatsText.replace(":",n.empty)+n.space+ed(d.repeatEvery)),p.appendChild(b)),Ua(d.location)&&(b=h("div","location"),z(b,d.location),p.appendChild(b)),Ua(d.description)&&(b=h("div","description"),z(b,d.description),p.appendChild(b));p.addEventListener("click",function(u){jg(u, -d)});Ya("onEventClick")&&p.addEventListener("click",function(){A("onEventClick",d)});c.manualEditingEnabled?p.ondblclick=function(u){B(u);Z(d,null,null,r)}:Ya("onEventDoubleClick")&&(p.ondblclick=function(){A("onEventDoubleClick",d)});d.isAllDay||Tj(a,a,k,p,d,!0);d.isAllDay||Xh.push({eventDetails:d,eventElement:p,height:p.offsetHeight});Ve.hasOwnProperty(e)||(Ve[e]=[]);Xe=0===Xe?p.offsetTop:Math.min(Xe,p.offsetTop);Ve[e].push(d);f=!0}return f}function Hd(a,b){b=q(b)?b:!1;bc=null===a?new Date:new Date(a); -Wd=null;Xb=[];Ve={};Wh=!1;sg=null;Xe=0;kd.style.display="none";Xh=[];var d=a;d=q(d)?new Date(d):new Date;0=e&&p<=d){var P=Aa("calendar-week-day-"+qa(p)),da=Aa("calendar-week-all-day-"+qa(p));null!==P&&ak(P,da,l,p)&&(u=!0)}lb(p)}u&&Xb.push(l);p=I(l.repeatEvery);r=!1;p>w.never&&(p===w.everyDay?r=ac(l,e,d,lb,1):p===w.everyWeek? -r=ac(l,e,d,Jb,1):p===w.every2Weeks?r=ac(l,e,d,Jb,2):p===w.everyMonth?r=ac(l,e,d,Rd,1):p===w.everyYear?r=ac(l,e,d,fd,1):p===w.custom&&(p=I(l.repeatEveryCustomType),H=I(l.repeatEveryCustomValue),0=e?4*c.spacing:e,jd.scrollTop=sg-e):jd.scrollTop=Xe);Db(Yj,0a){d=new Date(Ca,d,1);var e=1;d.setMonth(d.getMonth()+1);for(a+=1;43>a;a++)Am(b,d,a,e),e++}}function Am(a,b,d,e){a=Aa(a+d);if(null!==a){var f=new Date(b.getFullYear(),b.getMonth(),e);a.className+=" cell-muted";a.onclick=function(){qb(f,!0)};a.oncontextmenu=function(g){Zf(g,f)};$h(a,f);Fb(a,f)}}function $h(a,b,d){var e=Pd(b),f=!1;d=q(d)?d:!1;0<=c.weekendDays.indexOf(b.getDay())&&(a.className+= -" weekend-day");0<=c.workingDays.indexOf(qa(b))&&(a.className+=" working-day");if(Od.hasOwnProperty(e)){a.className+=" has-events";e=Od[e];var g=h("div","events-count");g.innerText=e.toString();a.appendChild(g)}d&&oc(b)&&(a.className+=" cell-today",f=!0);return f}function Gd(a,b){b=q(b)?b:!1;Ca=q(a)?a:y.getFullYear();tg=0;Yh.innerText=Ca;var d=b,e=d?0:Xd.scrollTop;Xd.innerHTML=n.empty;for(var f=0;12>f;f++)um(f);Xd.scrollTop=d?0c.minimumYear&&(--Ca,Gd(Ca, -!0))}function Ej(){Caw.never){var e=h("div","ib-refresh-medium ib-no-hover ib-no-active");e.style.borderColor=d.style.color;b.appendChild(e)}b.innerHTML+=Bc(a.title);d.appendChild(b);b=h("div","date");d.appendChild(b);e=h("div", -"duration");d.appendChild(e);a.from.getDate()===a.to.getDate()?a.isAllDay?Fb(b,a.from,null," - "+c.allDayText):(Fb(b,a.from,null," - "+Kd(a.from,a.to)),z(e,Gb(a.from,a.to))):(Le(b,a.from,a.to),z(e,Gb(a.from,a.to)));e.innerHTML===n.empty&&d.removeChild(e);Ba(a.repeatEvery)&&a.repeatEvery>w.never&&(b=h("div","repeats"),z(b,c.repeatsText.replace(":",n.empty)+n.space+ed(a.repeatEvery)),d.appendChild(b));Ua(a.location)&&(b=h("div","location"),z(b,a.location),d.appendChild(b));Ua(a.description)&&(b=h("div", -"description"),z(b,a.description),d.appendChild(b));d.addEventListener("click",function(f){jg(f,a)});Ya("onEventClick")&&d.addEventListener("click",function(){A("onEventClick",a)});c.manualEditingEnabled?d.ondblclick=function(f){B(f);Z(a)}:Ya("onEventDoubleClick")&&(d.ondblclick=function(){A("onEventDoubleClick",a)});Cb.push(a)}}function Cm(a){var b="month-"+a.getMonth()+"-"+a.getFullYear(),d=Aa(b);if(null===d){var e=new Date(a),f=function(){Cb=[];Td(xa);R(e)},g=Dm(a);null!==g&&ld.appendChild(g); -g=h("div","month");ld.appendChild(g);var k=h("div","header");z(k,c.monthNames[a.getMonth()]+n.space+a.getFullYear());k.ondblclick=f;g.appendChild(k);x(k,"ib-arrow-expand-left-right",c.expandMonthTooltipText,f);k.appendChild(h("div","right-divider-line"));if(c.manualEditingEnabled){var l=new Date(a.getFullYear(),a.getMonth(),1);x(k,"ib-plus",c.addEventTooltipText,function(){if(c.useTemplateWhenAddingNewEvent){var p=Uc(l,l);Z(p);Vc()}else Z(null,l)})}c.manualEditingEnabled&&x(k,"ib-close",c.removeEventsTooltipText, -function(){ck(e,Em)});f=function(){var p=r,u=d;"none"!==u.style.display?(u.style.display="none",p.className="ib-square-hollow",S.visibleAllEventsMonths[b]=!1,Xa(p,c.restoreTooltipText)):(u.style.display="block",p.className="ib-minus",S.visibleAllEventsMonths[b]=!0,Xa(p,c.minimizedTooltipText))};var r=x(k,"ib-minus",c.minimizedTooltipText,f);gg.push(f);d=h("div","events");d.id=b;g.appendChild(d);S.visibleAllEventsMonths.hasOwnProperty(b)&&!S.visibleAllEventsMonths[b]&&(d.style.display="none",r.className= -"ib-square-hollow",Xa(r,c.restoreTooltipText));$f(d,a.getFullYear(),a.getMonth(),a.getDate())}return d}function Dm(a){var b=null;if(-1===bi.indexOf(a.getFullYear())){bi.push(a.getFullYear());b=h("div","year-header");var d=h("span","header-text");z(d,a.getFullYear()+":");b.appendChild(d);d.onclick=function(){Gd(a.getFullYear(),!0)};b.appendChild(h("div","line"))}return b}function qj(a){a=q(a)?a:!1;rg(xa);ld.innerHTML=n.empty;Cb=[];gg=[];bi=[];a&&(ld.scrollTop=0);a=Bb(id());for(var b=a.length,d=0;d< -b;d++)Bm(a[d]);Db(bk,0w.never&&null!==kf;lf(c.confirmEventRemoveTitle,c.confirmEventRemoveMessage,function(){a();q(bb.id)&&(yg.checked||null===kf?(ka.removeEvent(bb.id,!0),Na(c.eventRemovedText.replace("{0}",bb.title))):(va(bb.seriesIgnoreDates)?bb.seriesIgnoreDates.push(kf):bb.seriesIgnoreDates= -[kf],Ga()),oa())},a,b)}),hf=ab(ca));di=Da(ca,"ib-arrow-top-right-icon",c.openUrlText,function(){ei(bb.url)});c.exportEventsEnabled&&(wg=ab(ca),vg=Da(ca,"ib-arrow-down-full-line-icon",c.exportEventsTooltipText+"...",function(){Id(Oa)}))}function ig(a,b,d){if(null!==ca){var e=E(b.url),f=We(b);ia(a)||Yb();bb=b;ek=new Date(d);kf=q(d)?d:null;1e&&he(d,db);a||(e>d||ew.never&&q(e)&&!sa(a.from,e),xf=e):(e=new Date,b=q(b)?b:e,oc(b)&&(b.setHours(e.getHours()),b.setMinutes(e.getMinutes())),e=sd(b,c.defaultEventDuration), -z(Gc,c.addEventTitle),qk(),jf.value=c.addText,xg.style.display="none",aa={},ee.checked=!1,mf.checked=!0,nf.checked=!0,ub.value=n.empty,pd.value=n.empty,qd.value=n.empty,od.value=n.empty,ge.value=n.empty,ie.value=c.defaultEventBackgroundColor,je.value=c.defaultEventTextColor,ke.value=c.defaultEventBorderColor,dc.checked=!0,Eg.checked=!1,Fg.checked=!1,Gg.checked=!1,Hg.checked=!1,Ig.checked=!1,Jg.checked=!1,Kg.checked=!1,rd.value=null,Kc.value="1",nd.checked=!0,fe.value=0,va(d)&&(b.setHours(d[0]),b.setMinutes(d[1]), -e.setHours(d[0]),e.setMinutes(d[1]),e=sd(e,c.defaultEventDuration)),Nb.value=ec(b,!1),Ob.value=ec(e,!1),he(b,Mb),he(e,db),ji=!1,xf=null);x(Gc,"ib-close",c.closeTooltipText,Hc,!0);a=We(a);for(var l in N)N.hasOwnProperty(l)&&q(N[l].eventEditorInput)&&(N[l].eventEditorInput.disabled=a);jf.disabled=a;Mb.disabled=a;db.disabled=a;Nb.disabled=a;Ob.disabled=a;ee.disabled=a;mf.disabled=a;nf.disabled=a;ub.disabled=a;ok.disabled=a;pd.disabled=a;qd.disabled=a;od.disabled=a;ge.disabled=a;dc.disabled=a;of.disabled= -a;pf.disabled=a;qf.disabled=a;rf.disabled=a;sf.disabled=a;Pb.disabled=a;Dg.disabled=a;fe.disabled=a;nk();jb.push(Hc);cb.style.display="block";ub.focus()}}function Vc(){ub.focus();ub.select()}function mk(){var a=Nb.value.split(":"),b=Ob.value.split(":"),d=td(ub.value),e=td(ge.value);if(2>a.length)yf(c.fromTimeErrorMessage);else if(2>b.length)yf(c.toTimeErrorMessage);else if(d===n.empty)yf(c.titleErrorMessage);else if(0f&&(d=1);return d})}function Pm(a){B(a);if("block"!==tb.style.display){Hk();a=v.history.length;tb.innerHTML=n.empty;pa.focus();for(var b= -0;bw.never){var f=h("div","ib-refresh-medium ib-no-hover ib-no-active");f.style.borderColor=wd.style.color;wd.appendChild(f)}wd.innerHTML+=Bc(b.title);Ba(b.repeatEvery)&& -b.repeatEvery>w.never?(z(If,c.repeatsText.replace(":",n.empty)+n.space+ed(b.repeatEvery)),cc(W,If)):(If.innerHTML=n.empty,mb(W,If));Ua(b.location)?(z(Kf,b.location),cc(W,Kf)):(Kf.innerHTML=n.empty,mb(W,Kf));Ua(b.description)?(z(Jf,b.description),cc(W,Jf)):(Jf.innerHTML=n.empty,mb(W,Jf));b.from.getDate()===b.to.getDate()?b.isAllDay?z(Hf,c.allDayText):(z(Hf,Kd(b.from,b.to)),z(xd,Gb(b.from,b.to))):(Le(Hf,b.from,b.to),z(xd,Gb(b.from,b.to)));xd.innerHTML===n.empty&&W.removeChild(xd)}Ye(a,W)}},c.eventTooltipDelay, -!1)}function Ac(){gd(Ka.showToolTip);Lk()&&(W.style.display="none",Pe=null,W.onmousemove=null)}function Lk(){return Bi(Ka.showToolTip)||null!==W&&"block"===W.style.display}function Xa(a,b,d){null!==a&&(a.onmousemove=function(e){Lj(e,null,b,d)})}function Na(a,b){if(null!==Ub&&c.popUpNotificationsEnabled){b=q(b)?b:!0;gd(Ka.hideNotification);Ub.innerHTML=n.empty;var d=h("div",b?"success":"error");Ub.appendChild(d);Ub.style.display="block";z(d,a);x(d,"ib-close-icon",c.closeTooltipText,Mk);cd(Ka.hideNotification, -function(){Mk()},5E3,!1)}}function Mk(){Ub.style.display="none"}function Ch(a,b){b=q(b)?b:!0;var d=c.dayHeaderNames.length;a.innerHTML=n.empty;c.startOfWeekDay===wa.saturday||c.startOfWeekDay===wa.sunday?(Ci(a,c.startOfWeekDay,d),Ci(a,0,c.startOfWeekDay)):Ci(a,0,d);c.reverseOrderDaysOfWeek&&b&&Tc(a)}function Ci(a,b,d){for(;bb;b++){var d=h("div","hour"),e=new Date,f=new Date;a.appendChild(d);e.setHours(b,0,0,0);f.setHours(b,30,0,0);var g=h("div","hour-text");g.innerText=ec(e);d.appendChild(g);e=h("div","hour-text");e.innerText=ec(f);d.appendChild(e)}}function kg(a,b){var d=lg(b);d=Math.floor((a.pageY-d.top)/(b.offsetHeight/1440))/60;var e=Math.floor(d);return[e,Math.round(60*(d-e))]}function Tj(a,b,d,e,f){var g=b.offsetHeight,k=b.offsetHeight/1440;b=0;var l=null;if(!f.isAllDay){l= -I(f.repeatEvery);if(sa(f.from,d)||l>w.never)b=k*Di(f.from);l=sa(f.to,d)||l>w.never?k*Di(f.to)-b:g;l-=2*c.spacing}b<=c.spacing&&(b+=c.spacing,l-=c.spacing);e.style.top=b+"px";null!==l&&(e.style.height=l+"px");e.offsetTop+e.offsetHeight>g-c.spacing?(d=g-e.offsetTop-3*c.spacing+"px",e.style.height=d,e.style.maxHeight=d):e.style.maxHeight=g-(e.offsetTop+2*c.spacing)-k+"px";e=b+a.offsetHeight/2;e<=a.offsetHeight&&(e=0);return e}function Vj(a,b,d,e){var f=0;null!==d&&(Wj(a,b)?(a=e.offsetHeight/1440*Di(new Date), -d.style.display="block",d.style.top=a-d.offsetHeight/2+"px",f=a):d.style.display="none");return f}function Wj(a,b){return oc(a)&&J(b)&&c.showTimelineArrowsOnViews}function Sj(a,b){B(a);var d=null;na.getComputedStyle?d=document.defaultView.getComputedStyle(b,null).getPropertyValue("z-index"):b.currentStyle&&(d=b.currentStyle["z-index"]);d=null===d||"auto"===d?1:parseInt(d)+1;b.style.zIndex=d.toString()}function Xj(a){a=a.getElementsByClassName("event");a=[].slice.call(a);var b=a.length;if(1H+P||l+pu+da)k=!1;k&&(k=E(e.getAttribute("event-position")),l=E(g.getAttribute("event-position")),k===n.empty&&l===n.empty?(gh(e),gh(g),g.style.left=e.offsetLeft+e.offsetWidth+c.spacing+"px",e.setAttribute("event-position","left"),g.setAttribute("event-position","right")):k===n.empty&&"right"=== -l?(gh(e),e.setAttribute("event-position","left"),g.setAttribute("event-position","right")):k===n.empty&&"left"===l&&(e.style.left=g.offsetLeft+g.offsetWidth+c.spacing+"px",gh(e),e.setAttribute("event-position","right"),g.setAttribute("event-position","left")))}}}function gh(a){a.style.width=a.offsetWidth/2-(3*c.spacing+c.spacing/4)+"px"}function Um(a,b){var d=0;a.offsetTopb.offsetTop&&(d=1);return d}function Qj(a,b,d){B(a);null===mg?0===a.dataTransfer.files.length?Nk(a, -b.getFullYear(),b.getMonth(),b.getDate()):Ok(a):(sa(pg,b)||(ba=Kb,zd=pg,Pk(a,b.getFullYear(),b.getMonth(),b.getDate())),b=d.offsetHeight/1440,d=lg(d),a=(Math.abs(a.pageY)-d.top+og-ng)/b,Kb.from=sd(Kb.from,a),Kb.to=sd(Kb.to,a),eb(),A("onEventUpdated",Kb),Na(c.eventUpdatedText.replace("{0}",Kb.title)),oa(),Kb=mg=null,ng=og=0)}function Kh(a){B(a);if(c.manualEditingEnabled){var b=null;a=null;var d=0;J(ea)?(b=ya,a=qg,d=a.length):J(la)&&(b=Vd,a=Xh,d=a.length);if(null!==b&&0a.getDay()-1?6:a.getDay()-1}function Pc(a,b){return(new Date(a,b+1,0)).getDate()}function Ih(a){var b=c.thText;if(31===a||21===a||1===a)b=c.stText;else if(22===a||2===a)b=c.ndText;else if(23===a||3===a)b=c.rdText;return b}function Di(a){var b= -a.getHours();a=a.getMinutes();return 60*b+a}function Dc(a,b){var d=new Date(a.getFullYear(),a.getMonth(),a.getDate()),e=new Date(b.getFullYear(),b.getMonth(),b.getDate());return Math.ceil(Math.abs(e-d)/864E5)}function lb(a,b){b=Ba(b)?b:1;a.setDate(a.getDate()+b)}function Jb(a,b){b=Ba(b)?b:1;a.setDate(a.getDate()+7*b)}function Rd(a,b){b=Ba(b)?b:1;a.setMonth(a.getMonth()+b)}function fd(a,b){b=Ba(b)?b:1;a.setFullYear(a.getFullYear()+b)}function Gb(a,b){var d=[],e=Math.abs(b-a)/1E3,f=Math.floor(e/86400); -e-=86400*f;0=g.toString().length&&(d=g);!isNaN(f)&&2>=f.toString().length&&(e=f)}a.setHours(d);a.setMinutes(e)}function sd(a,b){return new Date(a.getTime()+6E4*b)}function Gh(a,b){var d=a,e=qa(b);d=d.replace("{dddd}",c.dayNames[e]);d=d.replace("{ddd}",c.dayNamesAbbreviated[e]);d=d.replace("{dd}",O(b.getDate()));d=d.replace("{d}",b.getDate());d=d.replace("{o}",Ih(b.getDate()));d=d.replace("{mmmm}",c.monthNames[b.getMonth()]);d=d.replace("{mmm}",c.monthNamesAbbreviated[b.getMonth()]); -d=d.replace("{mm}",O(b.getMonth()+1));d=d.replace("{m}",b.getMonth()+1);d=d.replace("{yyyy}",b.getFullYear());d=d.replace("{yyy}",b.getFullYear().toString().substring(1));d=d.replace("{yy}",b.getFullYear().toString().substring(2));return d=d.replace("{y}",parseInt(b.getFullYear().toString().substring(2)).toString())}function xe(a){if(c.startOfWeekDay===wa.saturday||c.startOfWeekDay===wa.sunday)a+=7-c.startOfWeekDay;return a}function Kd(a,b){return ec(a)+n.space+c.toTimeText+n.space+ec(b)}function ec(a, -b){b=q(b)?b:c.useAmPmForTimeDisplays;if(c.useAmPmForTimeDisplays&&b){var d=a.getHours();var e=a.getMinutes(),f="am";12f&&(e=f));var g=Dc(ba.from,zd);f=Dc(ba.from,ba.to);a=new Date(b,d,e,ba.from.getHours(),ba.from.getMinutes());b=new Date(b,d,e,ba.to.getHours(), -ba.to.getMinutes());d=ba.repeatEnds;0ba.from?d.setDate(d.getDate()+e):d.setDate(d.getDate()-e));0=d&&f<=e){if(!F(b.showAsBusy)||b.showAsBusy)Nd=!0;(!cl.hasOwnProperty(b.id)&&!F(b.showAlerts)||b.showAlerts)&&dl(function(){Xm(b)},!1,b)}}}function Xm(a){cl[a.id]=!0;(new Notification(c.eventNotificationTitle,{body:c.eventNotificationBody.replace("{0}",a.title)})).onclick=function(){var b=E(a.url);b===n.empty?Z(a):ei(b);A("onNotificationClicked",a)}}function yi(){dl(function(){"granted"!==Notification.permission&& -Notification.requestPermission()})}function dl(a,b,d){c.eventNotificationsEnabled&&!t&&(b=q(b)?b:!0,Notification?a():b&&console.error("Browser notifications API unavailable."),q(d)&&A("onNotification",d))}function ei(a){na.open(a,c.urlWindowTarget);Sb("onEventUrlClicked",a)}function Md(a){a=q(a)?a:!0;for(var b=ja.length,d=0;dna.innerWidth?d-=b.offsetWidth:d++;e+b.offsetHeight>na.innerHeight?e-=b.offsetHeight:e++;db;b++){8!==b&&12!==b&&16!==b&&20!==b||a.push("-");var d=Math.floor(16*Math.random()).toString(16);a.push(d)}return a.join(n.empty)}function ua(a,b){return a.substring(0,b.length)===b}function Sm(a,b){var d=a;b=q(b)?b:30;a.length>b&&(d=0===b%2?b/2:(b-1)/2,d=a.substring(0,d)+"..."+a.substring(a.length-d));return d}function q(a){return void 0!== -a&&null!==a&&a!==n.empty}function Nh(a){return"function"===typeof a}function Og(a){return q(a)&&Nh(a)}function X(a){return q(a)&&"string"===typeof a}function Ba(a){return q(a)&&"number"===typeof a}function F(a){return q(a)&&"boolean"===typeof a}function mc(a){return q(a)&&"object"===typeof a}function va(a){return mc(a)&&a instanceof Array}function Ua(a){return X(a)&&a!==n.empty}function nc(a){return mc(a)&&a instanceof Date}function oj(a){return mc(a)&&void 0!==a.tagName}function rk(a){return/^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$/.test(a)} -function Jd(a,b){var d=va(a)&&va(b);d&&(a.sort(),b.sort(),d=JSON.stringify(a)===JSON.stringify(b));return d}function m(a,b){return X(a)?a:b}function C(a,b){return F(a)?a:b}function Ra(a,b){return Ba(a)?a:b}function Fi(a,b){return va(a)?a:b}function Gi(a,b){return nc(a)?a:b}function eb(){if(c.useLocalStorageForEvents&&na.localStorage){na.localStorage.clear();for(var a=Bb(id()),b=a.length,d=0;d');Ab.push("");q(gl)&&Ab.push(""+gl+"");Ab.push(""+Ji()+"");Ab.push("");Ab.push("");for(var Ki=0;Ki<$m;Ki++){var mh=l[Ki],hl=nh(mh),an=hl.length;Ab.push("");for(var Li=0;Li"+oh(pe,mh[pe])+"")}}Ab.push("")}Ab.push(""); -f=Ab.join(n.newLine)}else if("json"===b){var Wa=[],bn=l.length;Wa.push("{");Wa.push('"events": [');for(var Ni=0;Ni");Sa.push("");Sa.push("");Sa.push('');Sa.push('');q(ul)&&Sa.push(""+ul+"");Sa.push("");Sa.push("");for(var Vi=0;Vi"+Of.id+":");Sa.push("
    ");for(var Wi=0;Wi< -on;Wi++){var te=vl[Wi];"customTags"!==te&&Of.hasOwnProperty(te)&&null!==Of[te]&&Sa.push("
  • "+Mi(te)+": "+oh(te,Of[te])+"
  • ")}Sa.push("
")}Sa.push("");Sa.push("");f=Sa.join(n.newLine)}else if("tsv"===b){for(var pn=l.length,wl=Hi(),qn=wl[0],rn=wl[1],xl=[],Xi=[],Yi=0;Yi=c.minimumYear&&(R(a),A("onPreviousMonth",a))}function Ee(a){q(a)&&B(a);if(!t||Za)a=new Date(y),a.setMonth(a.getMonth()+ -1),a.getFullYear()<=c.maximumYear&&(R(a),A("onNextMonth",a))}function Vf(){if(!t||Za){var a=new Date(y);a.setFullYear(a.getFullYear()-1);a.getFullYear()>=c.minimumYear&&(R(a),A("onPreviousYear",a))}}function Xf(){if(!t||Za){var a=new Date(y);a.setFullYear(a.getFullYear()+1);a.getFullYear()<=c.maximumYear&&(R(a),A("onNextYear",a))}}function Wf(){if(!t||Za){var a=new Date;if(y.getMonth()!==a.getMonth()||y.getFullYear()!==a.getFullYear())R(),Sb("onToday")}}function Rf(a,b,d){N.hasOwnProperty(d)&&(X(a)? -N[d].text=a:N[d].text=b)}function Nc(a,b){b=Ba(b)?b:1;return!va(a)||a.length=c.minimumYear&&a.getFullYear()<=c.maximumYear&&(R(a),A("onSetDate",a)));return this};this.getSelectedDatePickerDate=function(){return t?new Date(rc):null};this.setSelectedDatePickerDate=function(a){nc(a)&&t&&(a=new Date(a),sj(a)&&!sa(a,rc)&&a.getFullYear()>=c.minimumYear&&a.getFullYear()<=c.maximumYear&&(a.setHours(0, -0,0,0),Rc(),Hh(a),A("onDatePickerDateChanged",a),rc=a));return this};this.exportAllEvents=function(a){c.exportEventsEnabled&&!t&&(a=X(a)?a:"csv",kc(null,a));return this};this.refresh=function(){t||Ta(!0,!0);return this};this.setEvents=function(a,b,d){t||(d=F(d)?d:!0,ob={},this.addEvents(a,b,!1),d&&A("onEventsSet",a));return this};this.setEventsFromJson=function(a,b,d){if(!t){d=F(d)?d:!0;var e=Ae(a);va(e)?this.setEvents(e,b,!1):mc(e)&&e.hasOwnProperty("events")&&this.setEvents(e.events,b,!1);d&&A("onEventsSetFromJSON", -a)}return this};this.addEvents=function(a,b,d){if(!t){b=F(b)?b:!0;d=F(d)?d:!0;for(var e=a.length,f=0;fc.maximumEventTitleLength&&(a.title=a.title.substring(0,c.maximumEventTitleLength));0c.maximumEventDescriptionLength&&(a.description=a.description.substring(0,c.maximumEventDescriptionLength));0c.maximumEventLocationLength&&(a.location=a.location.substring(0,c.maximumEventLocationLength));0c.maximumEventGroupLength&&(a.group=a.group.substring(0,c.maximumEventGroupLength));u===n.empty||rk(u)||(a.url=n.empty);nc(a.created)||(a.created=new Date);e&&(a.lastUpdated=new Date);ob[g][k]=rj(a);f=!0;d&&A("onEventAdded",a);b&&(eb(),Eb(),Ga(),oa())}}return f};this.updateEvents=function(a,b,d){if(!t){b=F(b)?b:!0;d=F(d)?d:!0;for(var e= -a.length,f=0;fa;a++)for(var b=0;7>b;b++){var d=Aa("calendar-day-"+(7*a+(b+1)));null!==d&&(Oh(d,"event"),Oh(d,"plus-x-events"))}Ah();Nd=!1;Wc=[];Od={};a=Bb(id());b= +a.length;for(d=0;dw.never&&(f===w.everyDay?Zb(e,lb,1):f===w.everyWeek?Zb(e,Jb,1):f===w.every2Weeks?Zb(e,Jb,2):f===w.everyMonth?Zb(e,Rd,1):f===w.everyYear?Zb(e,fd,1):f===w.custom&&(f=I(e.repeatEveryCustomType), +g=I(e.repeatEveryCustomValue),0=c.maximumEventsPerDayDisplay||c.useOnlyDotEventsForMainDisplay){e=h("div","event");var k=b.title;e.setAttribute("event-type",I(b.type));e.setAttribute("event-id",b.id);c.showTimesInMainCalendarEvents&&!b.isAllDay&&b.from.getDate()===b.to.getDate()&&(k=Kd(b.from,b.to)+": "+k);if(c.useOnlyDotEventsForMainDisplay)e.className+=" event-circle";else{if(I(b.repeatEvery)> +w.never){var l=h("div","ib-refresh-small ib-no-hover ib-no-active");l.style.borderColor=e.style.color;e.appendChild(l)}e.innerHTML+=Bc(k)}d.appendChild(e);Sh(e,b,a,d);Ke(e,b,cg(b,a),c.applyCssToEventsNotInCurrentMonth);hg(e,b);sa(b.from,a)&&(e.id="day-"+b.id);e.onmousemove=function(r){null!==Pe&&Pe.id===b.id?B(r):Lj(r,b)};e.oncontextmenu=function(r){ig(r,b,f)};e.addEventListener("click",function(r){jg(r,b)});Ya("onEventClick")&&e.addEventListener("click",function(){A("onEventClick",b)});c.manualEditingEnabled? +e.ondblclick=function(r){B(r);Z(b,null,null,g)}:Ya("onEventDoubleClick")&&(e.ondblclick=function(){A("onEventDoubleClick",b)})}else mm(d,a)}function mm(a,b){var d=a.getElementsByClassName("plus-x-events");d=0w.never&&(d=new Date(b),d.setHours(e.getHours(),e.getMinutes()),e=d);return e}function Qh(a){Od.hasOwnProperty(a)|| +(Od[a]=0);Od[a]++}function Ll(){if(!t){var a=null!==ea;a&&(ea.innerHTML=n.empty);a||(ea=h("div","full-day-view"),ea.id=Qc(),G.appendChild(ea));a=h("div","title-bar");ea.appendChild(a);c.fullScreenModeEnabled&&(a.ondblclick=hb);Qe=h("div","title");a.appendChild(Qe);x(a,"ib-close",c.closeTooltipText,nm);a.appendChild(h("div","right-divider-line"));c.showExtraToolbarButtons&&c.fullScreenModeEnabled&&(Th=x(a,"ib-arrow-expand-left-right",c.enableFullScreenTooltipText,hb),a.appendChild(h("div","right-divider-line-full-screen-mode"))); +x(a,"ib-arrow-right-full",c.nextDayTooltipText,Cj);c.manualEditingEnabled&&c.showExtraToolbarButtons&&x(a,"ib-plus",c.addEventTooltipText,function(){if(c.useTemplateWhenAddingNewEvent){var b=Uc(V,V);Z(b);Vc()}else Oc()});!t&&Fd()&&(x(a,"ib-hamburger",c.showMenuTooltipText,Sc),a.appendChild(h("div","left-divider-line")));x(a,"ib-arrow-left-full",c.previousDayTooltipText,zj);c.showExtraToolbarButtons&&(Nj=x(a,"ib-pin",c.todayTooltipText,Fj),x(a,"ib-refresh",c.refreshTooltipText,function(){Ta(!0,!0)}), +v.enabled&&(Oj=x(a,"ib-search",c.searchTooltipText,De)));sb=h("div","contents custom-scroll-bars");ea.appendChild(sb);sb.oncontextmenu=function(b){var d=kg(b,za);Re=O(d[0])+":"+O(d[1]);Pj(b,V,Wb)};Fc=h("div","content-events-all-day");sb.appendChild(Fc);a=h("div","all-day-text");z(a,c.allDayText);Fc.appendChild(a);za=h("div","contents-events");za.ondblclick=om;sb.appendChild(za);Sd=h("div","working-hours");sb.appendChild(Sd);c.manualEditingEnabled&&c.dragAndDropForEventsEnabled&&(za.ondragover=B,za.ondragenter= +B,za.ondragleave=B,za.ondrop=function(b){Qj(b,V,za)});Rj(za);Se=h("div","time-arrow");za.appendChild(Se);Se.appendChild(h("div","arrow-left"));Se.appendChild(h("div","line"))}}function $b(a,b,d,e,f){for(var g=new Date(a.from),k=Ec(a.repeatEveryExcludeDays);gw.never){var l=h("div","ib-refresh-medium ib-no-hover ib-no-active");l.style.borderColor=k.style.color;e.appendChild(l)}e.innerHTML+=Bc(a.title);k.appendChild(e);if(!a.isAllDay||c.showAllDayEventDetailsInFullDayView)e=h("div","date"),k.appendChild(e),l=h("div","duration"),k.appendChild(l),a.from.getDate()===a.to.getDate()?a.isAllDay?z(e,c.allDayText):(z(e,Kd(a.from,a.to)),z(l,Gb(a.from,a.to))):(Le(e,a.from,a.to),z(l,Gb(a.from,a.to))),l.innerHTML===n.empty&&k.removeChild(l), +Ba(a.repeatEvery)&&a.repeatEvery>w.never&&(e=h("div","repeats"),z(e,c.repeatsText.replace(":",n.empty)+n.space+ed(a.repeatEvery)),k.appendChild(e)),Ua(a.location)&&(e=h("div","location"),z(e,a.location),k.appendChild(e)),Ua(a.description)&&(e=h("div","description"),z(e,a.description),k.appendChild(e));k.addEventListener("click",function(r){jg(r,a)});Ya("onEventClick")&&k.addEventListener("click",function(){A("onEventClick",a)});c.manualEditingEnabled?k.ondblclick=function(r){B(r);Z(a,null,null,g)}: +Ya("onEventDoubleClick")&&(k.ondblclick=function(){A("onEventDoubleClick",a)});a.isAllDay||(d=Tj(sb,za,b,k,a));Wb.push(a);a.isAllDay||qg.push({eventDetails:a,eventElement:k,height:k.offsetHeight})}return d}function qb(a,b){a=q(a)?a:new Date;b=q(b)?b:!1;var d=qa(new Date);d=-1=d?4*c.spacing:d,sb.scrollTop=f-d):sb.scrollTop=g-sb.offsetHeight/2);1>=Fc.offsetHeight&&(Fc.style.display="none");Db(Oj,0w.never&&(e===w.everyDay?$b(d,b,a,lb,1):e===w.everyWeek?$b(d,b,a,Jb,1):e===w.every2Weeks?$b(d,b,a,Jb,2):e===w.everyMonth?$b(d,b,a,Rd,1):e===w.everyYear?$b(d,b,a,fd,1):e===w.custom&&(e=I(d.repeatEveryCustomType),f=I(d.repeatEveryCustomValue),0c.visibleDays.length)for(var a=qa(V);-1===c.visibleDays.indexOf(a);)V.setDate(V.getDate()-1),a=qa(V);qb(V,!0)}function Cj(){lb(V);if(7>c.visibleDays.length)for(var a=qa(V);-1===c.visibleDays.indexOf(a);)lb(V),a=qa(V);qb(V,!0)}function Fj(){V=new Date;qb(V,!0)}function Ml(){if(!t){var a=null!==la;a&&(la.innerHTML=n.empty);a||(la=h("div","full-week-view"),la.id=Qc(),G.appendChild(la));a=h("div","title-bar"); +la.appendChild(a);c.fullScreenModeEnabled&&(a.ondblclick=hb);Ma=h("div","title");a.appendChild(Ma);x(a,"ib-close",c.closeTooltipText,function(){Xb=[];Td(la)});a.appendChild(h("div","right-divider-line"));c.showExtraToolbarButtons&&c.fullScreenModeEnabled&&(Uh=x(a,"ib-arrow-expand-left-right",c.enableFullScreenTooltipText,hb),a.appendChild(h("div","right-divider-line-full-screen-mode")));x(a,"ib-arrow-right-full",c.nextWeekTooltipText,Dj);c.manualEditingEnabled&&c.showExtraToolbarButtons&&x(a,"ib-plus", +c.addEventTooltipText,Oc);!t&&Fd()&&(x(a,"ib-hamburger",c.showMenuTooltipText,Sc),a.appendChild(h("div","left-divider-line")));x(a,"ib-arrow-left-full",c.previousWeekTooltipText,Aj);c.showExtraToolbarButtons&&(x(a,"ib-pin",c.thisWeekTooltipText,Gj),x(a,"ib-refresh",c.refreshTooltipText,function(){Ta(!0,!0)}),v.enabled&&(Yj=x(a,"ib-search",c.searchTooltipText,De)));jd=h("div","contents custom-scroll-bars");la.appendChild(jd);qm()}}function qm(){var a=h("div","header-days-container");jd.appendChild(a); +Te=h("div","row-cells header-days");a.appendChild(Te);kd=h("div","content-events-all-day");jd.appendChild(kd);Ud=h("div","row-cells days");kd.appendChild(Ud);a=h("div","all-day-text");z(a,c.allDayText);kd.appendChild(a);Vd=h("div","hours");jd.appendChild(Vd);Rj(Vd);Ue=h("div","row-cells days");Vd.appendChild(Ue)}function Vh(a,b,d){for(;a=b&&g<=d){r=Aa("calendar-week-day-"+qa(g));var p=Aa("calendar-week-all-day-"+qa(g));null!==r&&(ak(r,p,a,g),l=!0)}}return l}function ak(a,b,d,e){var f=!1,g=Ec(d.seriesIgnoreDates),k=new Date(e),l=Pd(k),r=new Date(e);if(Qd(d)&&-1===g.indexOf(l)){var p=h("div","event");e=qa(k);p.setAttribute("event-type",I(d.type));p.setAttribute("event-id",d.id);a.appendChild(p);p.onclick=function(u){Sj(u,p)};p.oncontextmenu=function(u){ig(u,d,l)};d.isAllDay?(b.appendChild(p),Sh(p,d,k,b),Wh=!0):c.manualEditingEnabled&& +c.dragAndDropForEventsEnabled&&!We(d)&&(sa(d.from,d.to)&&!d.isAllDay&&(p.className+=" resizable"),p.ondragstart=function(u){var H=lg(p);mg=p;ng=p.offsetTop;Kb=d;og=H.top-u.pageY;pg=k},p.ondragEnd=Kh,p.setAttribute("draggable",!0));Ke(p,d,cg(d,k));hg(p,d);sa(d.from,k)&&(p.id="week-day-"+d.id);b=h("div","title");I(d.repeatEvery)>w.never&&(f=h("div","ib-refresh-medium ib-no-hover ib-no-active"),f.style.borderColor=p.style.color,b.appendChild(f));b.innerHTML+=Bc(d.title);p.appendChild(b);if(!d.isAllDay|| +c.showAllDayEventDetailsInFullDayView)b=h("div","date"),p.appendChild(b),f=h("div","duration"),p.appendChild(f),d.from.getDate()===d.to.getDate()?d.isAllDay?z(b,c.allDayText):(z(b,Kd(d.from,d.to)),z(f,Gb(d.from,d.to))):(Le(b,d.from,d.to),z(f,Gb(d.from,d.to))),f.innerHTML===n.empty&&p.removeChild(f),Ba(d.repeatEvery)&&d.repeatEvery>w.never&&(b=h("div","repeats"),z(b,c.repeatsText.replace(":",n.empty)+n.space+ed(d.repeatEvery)),p.appendChild(b)),Ua(d.location)&&(b=h("div","location"),z(b,d.location), +p.appendChild(b)),Ua(d.description)&&(b=h("div","description"),z(b,d.description),p.appendChild(b));p.addEventListener("click",function(u){jg(u,d)});Ya("onEventClick")&&p.addEventListener("click",function(){A("onEventClick",d)});c.manualEditingEnabled?p.ondblclick=function(u){B(u);Z(d,null,null,r)}:Ya("onEventDoubleClick")&&(p.ondblclick=function(){A("onEventDoubleClick",d)});d.isAllDay||Tj(a,a,k,p,d,!0);d.isAllDay||Xh.push({eventDetails:d,eventElement:p,height:p.offsetHeight});Ve.hasOwnProperty(e)|| +(Ve[e]=[]);Xe=0===Xe?p.offsetTop:Math.min(Xe,p.offsetTop);Ve[e].push(d);f=!0}return f}function Hd(a,b){b=q(b)?b:!1;bc=null===a?new Date:new Date(a);Wd=null;Xb=[];Ve={};Wh=!1;sg=null;Xe=0;kd.style.display="none";Xh=[];var d=a;d=q(d)?new Date(d):new Date;0=e&&p<=d){var P=Aa("calendar-week-day-"+qa(p)),da=Aa("calendar-week-all-day-"+ +qa(p));null!==P&&ak(P,da,l,p)&&(u=!0)}lb(p)}u&&Xb.push(l);p=I(l.repeatEvery);r=!1;p>w.never&&(p===w.everyDay?r=ac(l,e,d,lb,1):p===w.everyWeek?r=ac(l,e,d,Jb,1):p===w.every2Weeks?r=ac(l,e,d,Jb,2):p===w.everyMonth?r=ac(l,e,d,Rd,1):p===w.everyYear?r=ac(l,e,d,fd,1):p===w.custom&&(p=I(l.repeatEveryCustomType),H=I(l.repeatEveryCustomValue),0=e?4*c.spacing:e,jd.scrollTop=sg-e):jd.scrollTop=Xe);Db(Yj,0a){d=new Date(Ca,d,1);var e=1;d.setMonth(d.getMonth()+1);for(a+=1;43>a;a++)Am(b,d,a,e),e++}}function Am(a,b,d,e){a=Aa(a+d);if(null!==a){var f=new Date(b.getFullYear(),b.getMonth(),e);a.className+=" cell-muted";a.onclick=function(){qb(f,!0)}; +a.oncontextmenu=function(g){Zf(g,f)};$h(a,f);Fb(a,f)}}function $h(a,b,d){var e=Pd(b),f=!1;d=q(d)?d:!1;0<=c.weekendDays.indexOf(b.getDay())&&(a.className+=" weekend-day");0<=c.workingDays.indexOf(qa(b))&&(a.className+=" working-day");if(Od.hasOwnProperty(e)){a.className+=" has-events";e=Od[e];var g=h("div","events-count");g.innerText=e.toString();a.appendChild(g)}d&&oc(b)&&(a.className+=" cell-today",f=!0);return f}function Gd(a,b){b=q(b)?b:!1;Ca=q(a)?a:y.getFullYear();tg=0;Yh.innerText=Ca;var d=b, +e=d?0:Xd.scrollTop;Xd.innerHTML=n.empty;for(var f=0;12>f;f++)um(f);Xd.scrollTop=d?0c.minimumYear&&(--Ca,Gd(Ca,!0))}function Ej(){Caw.never){var e=h("div","ib-refresh-medium ib-no-hover ib-no-active"); +e.style.borderColor=d.style.color;b.appendChild(e)}b.innerHTML+=Bc(a.title);d.appendChild(b);b=h("div","date");d.appendChild(b);e=h("div","duration");d.appendChild(e);a.from.getDate()===a.to.getDate()?a.isAllDay?Fb(b,a.from,null," - "+c.allDayText):(Fb(b,a.from,null," - "+Kd(a.from,a.to)),z(e,Gb(a.from,a.to))):(Le(b,a.from,a.to),z(e,Gb(a.from,a.to)));e.innerHTML===n.empty&&d.removeChild(e);Ba(a.repeatEvery)&&a.repeatEvery>w.never&&(b=h("div","repeats"),z(b,c.repeatsText.replace(":",n.empty)+n.space+ +ed(a.repeatEvery)),d.appendChild(b));Ua(a.location)&&(b=h("div","location"),z(b,a.location),d.appendChild(b));Ua(a.description)&&(b=h("div","description"),z(b,a.description),d.appendChild(b));d.addEventListener("click",function(f){jg(f,a)});Ya("onEventClick")&&d.addEventListener("click",function(){A("onEventClick",a)});c.manualEditingEnabled?d.ondblclick=function(f){B(f);Z(a)}:Ya("onEventDoubleClick")&&(d.ondblclick=function(){A("onEventDoubleClick",a)});Cb.push(a)}}function Cm(a){var b="month-"+ +a.getMonth()+"-"+a.getFullYear(),d=Aa(b);if(null===d){var e=new Date(a),f=function(){Cb=[];Td(ya);R(e)},g=Dm(a);null!==g&&ld.appendChild(g);g=h("div","month");ld.appendChild(g);var k=h("div","header");z(k,c.monthNames[a.getMonth()]+n.space+a.getFullYear());k.ondblclick=f;g.appendChild(k);x(k,"ib-arrow-expand-left-right",c.expandMonthTooltipText,f);k.appendChild(h("div","right-divider-line"));if(c.manualEditingEnabled){var l=new Date(a.getFullYear(),a.getMonth(),1);x(k,"ib-plus",c.addEventTooltipText, +function(){if(c.useTemplateWhenAddingNewEvent){var p=Uc(l,l);Z(p);Vc()}else Z(null,l)})}c.manualEditingEnabled&&x(k,"ib-close",c.removeEventsTooltipText,function(){ck(e,Em)});f=function(){var p=r,u=d;"none"!==u.style.display?(u.style.display="none",p.className="ib-square-hollow",S.visibleAllEventsMonths[b]=!1,Xa(p,c.restoreTooltipText)):(u.style.display="block",p.className="ib-minus",S.visibleAllEventsMonths[b]=!0,Xa(p,c.minimizedTooltipText))};var r=x(k,"ib-minus",c.minimizedTooltipText,f);gg.push(f); +d=h("div","events");d.id=b;g.appendChild(d);S.visibleAllEventsMonths.hasOwnProperty(b)&&!S.visibleAllEventsMonths[b]&&(d.style.display="none",r.className="ib-square-hollow",Xa(r,c.restoreTooltipText));$f(d,a.getFullYear(),a.getMonth(),a.getDate())}return d}function Dm(a){var b=null;if(-1===bi.indexOf(a.getFullYear())){bi.push(a.getFullYear());b=h("div","year-header");var d=h("span","header-text");z(d,a.getFullYear()+":");b.appendChild(d);d.onclick=function(){Gd(a.getFullYear(),!0)};b.appendChild(h("div", +"line"))}return b}function qj(a){a=q(a)?a:!1;rg(ya);ld.innerHTML=n.empty;Cb=[];gg=[];bi=[];a&&(ld.scrollTop=0);a=Bb(id());for(var b=a.length,d=0;dw.never&&null!==kf;lf(c.confirmEventRemoveTitle,c.confirmEventRemoveMessage,function(){a();q(bb.id)&&(yg.checked||null===kf?(ka.removeEvent(bb.id, +!0),Na(c.eventRemovedText.replace("{0}",bb.title))):(va(bb.seriesIgnoreDates)?bb.seriesIgnoreDates.push(kf):bb.seriesIgnoreDates=[kf],Ga()),oa())},a,b)}),hf=ab(ca));di=Da(ca,"ib-arrow-top-right-icon",c.openUrlText,function(){ei(bb.url)});c.exportEventsEnabled&&(wg=ab(ca),vg=Da(ca,"ib-arrow-down-full-line-icon",c.exportEventsTooltipText+"...",function(){Id(Oa)}))}function ig(a,b,d){if(null!==ca){var e=E(b.url),f=We(b);ia(a)||Yb();bb=b;ek=new Date(d);kf=q(d)?d:null;1e&&he(d,db);a||(e>d||ew.never&&q(e)&&!sa(a.from,e),xf=e):(e=new Date,b=q(b)?b:e,oc(b)&&(b.setHours(e.getHours()),b.setMinutes(e.getMinutes())),e=sd(b,c.defaultEventDuration),z(Gc,c.addEventTitle),qk(),jf.value=c.addText,xg.style.display="none",aa={},ee.checked=!1,mf.checked=!0,nf.checked=!0,ub.value=n.empty,pd.value=n.empty,qd.value=n.empty,od.value=n.empty,ge.value=n.empty,ie.value=c.defaultEventBackgroundColor,je.value=c.defaultEventTextColor,ke.value=c.defaultEventBorderColor,dc.checked=!0, +Eg.checked=!1,Fg.checked=!1,Gg.checked=!1,Hg.checked=!1,Ig.checked=!1,Jg.checked=!1,Kg.checked=!1,rd.value=null,Kc.value="1",nd.checked=!0,fe.value=0,va(d)&&(b.setHours(d[0]),b.setMinutes(d[1]),e.setHours(d[0]),e.setMinutes(d[1]),e=sd(e,c.defaultEventDuration)),Nb.value=ec(b,!1),Ob.value=ec(e,!1),he(b,Mb),he(e,db),ji=!1,xf=null);x(Gc,"ib-close",c.closeTooltipText,Hc,!0);a=We(a);for(var l in N)N.hasOwnProperty(l)&&q(N[l].eventEditorInput)&&(N[l].eventEditorInput.disabled=a);jf.disabled=a;Mb.disabled= +a;db.disabled=a;Nb.disabled=a;Ob.disabled=a;ee.disabled=a;mf.disabled=a;nf.disabled=a;ub.disabled=a;ok.disabled=a;pd.disabled=a;qd.disabled=a;od.disabled=a;ge.disabled=a;dc.disabled=a;of.disabled=a;pf.disabled=a;qf.disabled=a;rf.disabled=a;sf.disabled=a;Pb.disabled=a;Dg.disabled=a;fe.disabled=a;nk();jb.push(Hc);cb.style.display="block";ub.focus()}}function Vc(){ub.focus();ub.select()}function mk(){var a=Nb.value.split(":"),b=Ob.value.split(":"),d=td(ub.value),e=td(ge.value);if(2>a.length)yf(c.fromTimeErrorMessage); +else if(2>b.length)yf(c.toTimeErrorMessage);else if(d===n.empty)yf(c.titleErrorMessage);else if(0f&&(d=1);return d})}function Pm(a){B(a);if("block"!==tb.style.display){Hk();a=v.history.length;tb.innerHTML=n.empty;pa.focus();for(var b=0;bw.never){var f=h("div","ib-refresh-medium ib-no-hover ib-no-active"); +f.style.borderColor=wd.style.color;wd.appendChild(f)}wd.innerHTML+=Bc(b.title);Ba(b.repeatEvery)&&b.repeatEvery>w.never?(z(If,c.repeatsText.replace(":",n.empty)+n.space+ed(b.repeatEvery)),cc(W,If)):(If.innerHTML=n.empty,mb(W,If));Ua(b.location)?(z(Kf,b.location),cc(W,Kf)):(Kf.innerHTML=n.empty,mb(W,Kf));Ua(b.description)?(z(Jf,b.description),cc(W,Jf)):(Jf.innerHTML=n.empty,mb(W,Jf));b.from.getDate()===b.to.getDate()?b.isAllDay?z(Hf,c.allDayText):(z(Hf,Kd(b.from,b.to)),z(xd,Gb(b.from,b.to))):(Le(Hf, +b.from,b.to),z(xd,Gb(b.from,b.to)));xd.innerHTML===n.empty&&W.removeChild(xd)}Ye(a,W)}},c.eventTooltipDelay,!1)}function Ac(){gd(Ka.showToolTip);Lk()&&(W.style.display="none",Pe=null,W.onmousemove=null)}function Lk(){return Bi(Ka.showToolTip)||null!==W&&"block"===W.style.display}function Xa(a,b,d){null!==a&&(a.onmousemove=function(e){Lj(e,null,b,d)})}function Na(a,b){if(null!==Ub&&c.popUpNotificationsEnabled){b=q(b)?b:!0;gd(Ka.hideNotification);Ub.innerHTML=n.empty;var d=h("div",b?"success":"error"); +Ub.appendChild(d);Ub.style.display="block";z(d,a);x(d,"ib-close-icon",c.closeTooltipText,Mk);cd(Ka.hideNotification,function(){Mk()},5E3,!1)}}function Mk(){Ub.style.display="none"}function Ch(a,b){b=q(b)?b:!0;var d=c.dayHeaderNames.length;a.innerHTML=n.empty;c.startOfWeekDay===xa.saturday||c.startOfWeekDay===xa.sunday?(Ci(a,c.startOfWeekDay,d),Ci(a,0,c.startOfWeekDay)):Ci(a,0,d);c.reverseOrderDaysOfWeek&&b&&Tc(a)}function Ci(a,b,d){for(;bb;b++){var d=h("div","hour"),e=new Date,f=new Date;a.appendChild(d);e.setHours(b,0,0,0);f.setHours(b,30,0,0);var g=h("div","hour-text");g.innerText=ec(e);d.appendChild(g);e=h("div","hour-text");e.innerText=ec(f);d.appendChild(e)}}function kg(a,b){var d=lg(b);d=Math.floor((a.pageY-d.top)/(b.offsetHeight/1440))/60;var e=Math.floor(d);return[e,Math.round(60*(d-e))]}function Tj(a, +b,d,e,f){var g=b.offsetHeight,k=b.offsetHeight/1440;b=0;var l=null;if(!f.isAllDay){l=I(f.repeatEvery);if(sa(f.from,d)||l>w.never)b=k*Di(f.from);l=sa(f.to,d)||l>w.never?k*Di(f.to)-b:g;l-=2*c.spacing}b<=c.spacing&&(b+=c.spacing,l-=c.spacing);e.style.top=b+"px";null!==l&&(e.style.height=l+"px");e.offsetTop+e.offsetHeight>g-c.spacing?(d=g-e.offsetTop-3*c.spacing+"px",e.style.height=d,e.style.maxHeight=d):e.style.maxHeight=g-(e.offsetTop+2*c.spacing)-k+"px";e=b+a.offsetHeight/2;e<=a.offsetHeight&&(e=0); +return e}function Vj(a,b,d,e){var f=0;null!==d&&(Wj(a,b)?(a=e.offsetHeight/1440*Di(new Date),d.style.display="block",d.style.top=a-d.offsetHeight/2+"px",f=a):d.style.display="none");return f}function Wj(a,b){return oc(a)&&J(b)&&c.showTimelineArrowsOnViews}function Sj(a,b){B(a);var d=null;na.getComputedStyle?d=document.defaultView.getComputedStyle(b,null).getPropertyValue("z-index"):b.currentStyle&&(d=b.currentStyle["z-index"]);d=null===d||"auto"===d?1:parseInt(d)+1;b.style.zIndex=d.toString()}function Xj(a){a= +a.getElementsByClassName("event");a=[].slice.call(a);var b=a.length;if(1H+P||l+pu+da)k=!1;k&&(k=E(e.getAttribute("event-position")),l=E(g.getAttribute("event-position")),k===n.empty&&l===n.empty?(gh(e),gh(g),g.style.left=e.offsetLeft+e.offsetWidth+c.spacing+"px",e.setAttribute("event-position", +"left"),g.setAttribute("event-position","right")):k===n.empty&&"right"===l?(gh(e),e.setAttribute("event-position","left"),g.setAttribute("event-position","right")):k===n.empty&&"left"===l&&(e.style.left=g.offsetLeft+g.offsetWidth+c.spacing+"px",gh(e),e.setAttribute("event-position","right"),g.setAttribute("event-position","left")))}}}function gh(a){a.style.width=a.offsetWidth/2-(3*c.spacing+c.spacing/4)+"px"}function Um(a,b){var d=0;a.offsetTopb.offsetTop&&(d=1);return d} +function Qj(a,b,d){B(a);null===mg?0===a.dataTransfer.files.length?Nk(a,b.getFullYear(),b.getMonth(),b.getDate()):Ok(a):(sa(pg,b)||(ba=Kb,zd=pg,Pk(a,b.getFullYear(),b.getMonth(),b.getDate())),b=d.offsetHeight/1440,d=lg(d),a=(Math.abs(a.pageY)-d.top+og-ng)/b,Kb.from=sd(Kb.from,a),Kb.to=sd(Kb.to,a),eb(),A("onEventUpdated",Kb),Na(c.eventUpdatedText.replace("{0}",Kb.title)),oa(),Kb=mg=null,ng=og=0)}function Kh(a){B(a);if(c.manualEditingEnabled){var b=null;a=null;var d=0;J(ea)?(b=za,a=qg,d=a.length):J(la)&& +(b=Vd,a=Xh,d=a.length);if(null!==b&&0a.getDay()-1?6:a.getDay()-1}function Pc(a,b){return(new Date(a,b+1,0)).getDate()}function Ih(a){var b=c.thText;if(31===a||21===a||1=== +a)b=c.stText;else if(22===a||2===a)b=c.ndText;else if(23===a||3===a)b=c.rdText;return b}function Di(a){var b=a.getHours();a=a.getMinutes();return 60*b+a}function Dc(a,b){var d=new Date(a.getFullYear(),a.getMonth(),a.getDate()),e=new Date(b.getFullYear(),b.getMonth(),b.getDate());return Math.ceil(Math.abs(e-d)/864E5)}function lb(a,b){b=Ba(b)?b:1;a.setDate(a.getDate()+b)}function Jb(a,b){b=Ba(b)?b:1;a.setDate(a.getDate()+7*b)}function Rd(a,b){b=Ba(b)?b:1;a.setMonth(a.getMonth()+b)}function fd(a,b){b= +Ba(b)?b:1;a.setFullYear(a.getFullYear()+b)}function Gb(a,b){var d=[],e=Math.abs(b-a)/1E3,f=Math.floor(e/86400);e-=86400*f;0=g.toString().length&&(d=g);!isNaN(f)&&2>=f.toString().length&&(e=f)}a.setHours(d);a.setMinutes(e)}function sd(a,b){return new Date(a.getTime()+6E4*b)}function Gh(a,b){var d=a,e=qa(b);d=d.replace("{dddd}",c.dayNames[e]);d=d.replace("{ddd}",c.dayNamesAbbreviated[e]);d=d.replace("{dd}",O(b.getDate()));d=d.replace("{d}",b.getDate());d=d.replace("{o}", +Ih(b.getDate()));d=d.replace("{mmmm}",c.monthNames[b.getMonth()]);d=d.replace("{mmm}",c.monthNamesAbbreviated[b.getMonth()]);d=d.replace("{mm}",O(b.getMonth()+1));d=d.replace("{m}",b.getMonth()+1);d=d.replace("{yyyy}",b.getFullYear());d=d.replace("{yyy}",b.getFullYear().toString().substring(1));d=d.replace("{yy}",b.getFullYear().toString().substring(2));return d=d.replace("{y}",parseInt(b.getFullYear().toString().substring(2)).toString())}function xe(a){if(c.startOfWeekDay===xa.saturday||c.startOfWeekDay=== +xa.sunday)a+=7-c.startOfWeekDay;return a}function Kd(a,b){return ec(a)+n.space+c.toTimeText+n.space+ec(b)}function ec(a,b){b=q(b)?b:c.useAmPmForTimeDisplays;if(c.useAmPmForTimeDisplays&&b){var d=a.getHours();var e=a.getMinutes(),f="am";12f&&(e=f));var g=Dc(ba.from,zd);f=Dc(ba.from,ba.to);a=new Date(b,d,e,ba.from.getHours(),ba.from.getMinutes());b=new Date(b,d,e,ba.to.getHours(),ba.to.getMinutes());d=ba.repeatEnds;0ba.from?d.setDate(d.getDate()+e):d.setDate(d.getDate()-e));0=d&&f<=e){if(!F(b.showAsBusy)||b.showAsBusy)Nd=!0;(!cl.hasOwnProperty(b.id)&&!F(b.showAlerts)||b.showAlerts)&&dl(function(){Xm(b)},!1,b)}}}function Xm(a){cl[a.id]= +!0;(new Notification(c.eventNotificationTitle,{body:c.eventNotificationBody.replace("{0}",a.title)})).onclick=function(){var b=E(a.url);b===n.empty?Z(a):ei(b);A("onNotificationClicked",a)}}function yi(){dl(function(){"granted"!==Notification.permission&&Notification.requestPermission()})}function dl(a,b,d){c.eventNotificationsEnabled&&!t&&(b=q(b)?b:!0,Notification?a():b&&console.error("Browser notifications API unavailable."),q(d)&&A("onNotification",d))}function ei(a){na.open(a,c.urlWindowTarget); +Sb("onEventUrlClicked",a)}function Md(a){a=q(a)?a:!0;for(var b=ja.length,d=0;dna.innerWidth?d-=b.offsetWidth:d++;e+b.offsetHeight>na.innerHeight?e-= +b.offsetHeight:e++;db;b++){8!==b&&12!==b&&16!==b&&20!==b||a.push("-");var d=Math.floor(16*Math.random()).toString(16);a.push(d)}return a.join(n.empty)} +function ua(a,b){return a.substring(0,b.length)===b}function Sm(a,b){var d=a;b=q(b)?b:30;a.length>b&&(d=0===b%2?b/2:(b-1)/2,d=a.substring(0,d)+"..."+a.substring(a.length-d));return d}function q(a){return void 0!==a&&null!==a&&a!==n.empty}function Nh(a){return"function"===typeof a}function Og(a){return q(a)&&Nh(a)}function X(a){return q(a)&&"string"===typeof a}function Ba(a){return q(a)&&"number"===typeof a}function F(a){return q(a)&&"boolean"===typeof a}function mc(a){return q(a)&&"object"===typeof a} +function va(a){return mc(a)&&a instanceof Array}function Ua(a){return X(a)&&a!==n.empty}function nc(a){return mc(a)&&a instanceof Date}function oj(a){return mc(a)&&void 0!==a.tagName}function rk(a){return/^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$/.test(a)}function Jd(a,b){var d=va(a)&&va(b);d&&(a.sort(),b.sort(),d=JSON.stringify(a)===JSON.stringify(b));return d}function m(a,b){return X(a)?a:b}function C(a,b){return F(a)?a:b}function Ra(a, +b){return Ba(a)?a:b}function Fi(a,b){return va(a)?a:b}function Gi(a,b){return nc(a)?a:b}function eb(){if(c.useLocalStorageForEvents&&na.localStorage){na.localStorage.clear();for(var a=Bb(id()),b=a.length,d=0;d');Ab.push("");q(gl)&&Ab.push(""+gl+"");Ab.push(""+ +Ji()+"");Ab.push("");Ab.push("");for(var Ki=0;Ki<$m;Ki++){var mh=l[Ki],hl=nh(mh),an=hl.length;Ab.push("");for(var Li=0;Li"+oh(pe,mh[pe])+"")}}Ab.push("")}Ab.push("");f=Ab.join(n.newLine)}else if("json"===b){var Wa=[],bn=l.length;Wa.push("{");Wa.push('"events": [');for(var Ni=0;Ni"); +Sa.push("");Sa.push("");Sa.push('');Sa.push('');q(ul)&&Sa.push(""+ul+"");Sa.push("");Sa.push("");for(var Vi=0;Vi"+Of.id+":");Sa.push("
    ");for(var Wi=0;Wi"+Mi(te)+": "+oh(te,Of[te])+"")}Sa.push("
")}Sa.push(""); +Sa.push("");f=Sa.join(n.newLine)}else if("tsv"===b){for(var pn=l.length,wl=Hi(),qn=wl[0],rn=wl[1],xl=[],Xi=[],Yi=0;Yi=c.minimumYear&&(R(a),A("onPreviousMonth",a))}function Ee(a){q(a)&&B(a);if(!t||Za)a=new Date(y),a.setMonth(a.getMonth()+1),a.getFullYear()<=c.maximumYear&&(R(a),A("onNextMonth",a))}function Vf(){if(!t||Za){var a=new Date(y);a.setFullYear(a.getFullYear()- +1);a.getFullYear()>=c.minimumYear&&(R(a),A("onPreviousYear",a))}}function Xf(){if(!t||Za){var a=new Date(y);a.setFullYear(a.getFullYear()+1);a.getFullYear()<=c.maximumYear&&(R(a),A("onNextYear",a))}}function Wf(){if(!t||Za){var a=new Date;if(y.getMonth()!==a.getMonth()||y.getFullYear()!==a.getFullYear())R(),Sb("onToday")}}function Rf(a,b,d){N.hasOwnProperty(d)&&(X(a)?N[d].text=a:N[d].text=b)}function Nc(a,b){b=Ba(b)?b:1;return!va(a)||a.length=c.minimumYear&&a.getFullYear()<=c.maximumYear&&(R(a),A("onSetDate",a)));return this};this.getSelectedDatePickerDate=function(){return t?new Date(rc):null};this.setSelectedDatePickerDate=function(a){nc(a)&&t&&(a=new Date(a),sj(a)&&!sa(a,rc)&&a.getFullYear()>=c.minimumYear&&a.getFullYear()<=c.maximumYear&&(a.setHours(0,0,0,0),Rc(),Hh(a),A("onDatePickerDateChanged",a),rc=a));return this};this.exportAllEvents=function(a){c.exportEventsEnabled&&!t&&(a=X(a)?a:"csv",kc(null,a)); +return this};this.refresh=function(){t||Ta(!0,!0);return this};this.setEvents=function(a,b,d){t||(d=F(d)?d:!0,ob={},this.addEvents(a,b,!1),d&&A("onEventsSet",a));return this};this.setEventsFromJson=function(a,b,d){if(!t){d=F(d)?d:!0;var e=Ae(a);va(e)?this.setEvents(e,b,!1):mc(e)&&e.hasOwnProperty("events")&&this.setEvents(e.events,b,!1);d&&A("onEventsSetFromJSON",a)}return this};this.addEvents=function(a,b,d){if(!t){b=F(b)?b:!0;d=F(d)?d:!0;for(var e=a.length,f=0;fc.maximumEventTitleLength&&(a.title=a.title.substring(0,c.maximumEventTitleLength));0c.maximumEventDescriptionLength&&(a.description=a.description.substring(0,c.maximumEventDescriptionLength));0c.maximumEventLocationLength&&(a.location=a.location.substring(0,c.maximumEventLocationLength)); +0c.maximumEventGroupLength&&(a.group=a.group.substring(0,c.maximumEventGroupLength));u===n.empty||rk(u)||(a.url=n.empty);nc(a.created)||(a.created=new Date);e&&(a.lastUpdated=new Date);ob[g][k]=rj(a);f=!0;d&&A("onEventAdded",a);b&&(eb(),Eb(),Ga(),oa())}}return f};this.updateEvents=function(a,b,d){if(!t){b=F(b)?b:!0;d=F(d)?d:!0;for(var e=a.length,f=0;f + + ## Version 2.8.1: - In Widget mode, if the date is the current date, the widget will jump to the next day automatically when the day changes. - Events in the Full Day/Week views can no longer be resized over the height of the day. diff --git a/package.json b/package.json index 07d0f5e5..8e60e765 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "jcalendar.js", "title": "Calendar.js", "description": "A javascript drag & drop event calendar, that is fully responsive and compatible with all modern browsers.", - "version": "2.8.1", + "version": "2.8.2", "main": "dist/calendar.js", "homepage": "https://williamtroup.github.io/Calendar.js/", "author": { diff --git a/src/calendar.binding.js b/src/calendar.binding.js index bdc25356..b5e2d2ab 100644 --- a/src/calendar.binding.js +++ b/src/calendar.binding.js @@ -4,7 +4,7 @@ * A javascript drag & drop event calendar, that is fully responsive and compatible with all modern browsers. * * @file calendar.binding.js - * @version v2.8.1 + * @version v2.8.2 * @author Bunoon * @license GNU AGPLv3 * @copyright Bunoon 2023 diff --git a/src/calendar.jquery.js b/src/calendar.jquery.js index c43acd85..caf0d86c 100644 --- a/src/calendar.jquery.js +++ b/src/calendar.jquery.js @@ -4,7 +4,7 @@ * A javascript drag & drop event calendar, that is fully responsive and compatible with all modern browsers. * * @file calendar.jquery.js - * @version v2.8.1 + * @version v2.8.2 * @author Bunoon * @license GNU AGPLv3 * @copyright Bunoon 2023 diff --git a/src/calendar.js b/src/calendar.js index 6e5ed853..52fdc56d 100644 --- a/src/calendar.js +++ b/src/calendar.js @@ -4,7 +4,7 @@ * A javascript drag & drop event calendar, that is fully responsive and compatible with all modern browsers. * * @file calendar.js - * @version v2.8.1 + * @version v2.8.2 * @author Bunoon * @license GNU AGPLv3 * @copyright Bunoon 2023 @@ -2570,6 +2570,7 @@ function calendarJs( elementOrId, options, searchOptions ) { } hideTooltip(); + hideAllContextMenusAcrossInstances(); if ( hideSearchHistoryDropDown ) { hideSearchHistoryDropDownMenu(); @@ -4973,6 +4974,20 @@ function calendarJs( elementOrId, options, searchOptions ) { return closed; } + function hideAllContextMenusAcrossInstances() { + var elements = _document.getElementsByClassName( "calendar-context-menu" ), + elementsArray = [].slice.call( elements ), + elementsArrayLength = elementsArray.length; + + for ( var elementsArrayIndex = 0; elementsArrayIndex < elementsArrayLength; elementsArrayIndex++ ) { + var element = elementsArray[ elementsArrayIndex ]; + + if ( element.id !== _elementID ) { + element.style.display = "none"; + } + } + } + function isContextMenuVisible( element ) { return element !== null && element.style.display === "block"; } @@ -12604,7 +12619,7 @@ function calendarJs( elementOrId, options, searchOptions ) { * @returns {string} The version number. */ this.getVersion = function() { - return "2.8.1"; + return "2.8.2"; }; /** diff --git a/src/calendar.js.scss b/src/calendar.js.scss index 7dc3d453..c3286cc7 100644 --- a/src/calendar.js.scss +++ b/src/calendar.js.scss @@ -1,5 +1,5 @@ /* - * Calendar.js Library v2.8.1 + * Calendar.js Library v2.8.2 * * Copyright 2023 Bunoon * Released under the GNU AGPLv3 license