";for(var C=0;C<7;C++){F+="=H){M="dhx_after"}else{if(I.valueOf()==A.valueOf()){M="dhx_now"}}}F+=" class='"+M+" "+this.templates.month_date_class(I,A)+"' ";F+="> "+this.templates.month_day(I)+" | ";I=this.date.add(I,1,"day")}F+="";G[E]=D;D+=this._colsS.height}F+="";this._max_date=I;J.innerHTML=F;return I};scheduler.getLabel=function(E,D){var F=this.config.lightbox.sections;for(var C=0;C11?"pm":"am")+"';case"%A":return'"+(date.getHours()>11?"PM":"AM")+"';case"%s":return'"+scheduler.date.to_fixed(date.getSeconds())+"';case"%W":return'"+scheduler.date.to_fixed(scheduler.date.getISOWeek(date))+"';default:return C}});if(A){B=B.replace(/date\.get/g,"date.getUTC")}return new Function("date",'return "'+B+'";')},str_to_date:function(E,C){var F="var temp=date.split(/[^0-9a-zA-Z]+/g);";var A=E.match(/%[a-zA-Z]/g);for(var B=0;B50?1900:2000);";break;case"%g":case"%G":case"%h":case"%H":F+="set[3]=temp["+B+"]||0;";break;case"%i":F+="set[4]=temp["+B+"]||0;";break;case"%Y":F+="set[0]=temp["+B+"]||0;";break;case"%a":case"%A":F+="set[3]=set[3]%12+((temp["+B+"]||'').toLowerCase()=='am'?0:12);";break;case"%s":F+="set[5]=temp["+B+"]||0;";break}}var D="set[0],set[1],set[2],set[3],set[4],set[5]";if(C){D=" Date.UTC("+D+")"}return new Function("date","var set=[0,0,1,0,0,0]; "+F+" return new Date("+D+");")},getISOWeek:function(C){if(!C){return false}var B=C.getDay();if(B==0){B=7}var D=new Date(C.valueOf());D.setDate(C.getDate()+(4-B));var A=D.getFullYear();var F=Math.floor((D.getTime()-new Date(A,0,1).getTime())/86400000);var E=1+Math.floor(F/7);return E},getUTCISOWeek:function(A){return this.getISOWeek(A)}};scheduler.locale={date:{month_full:["January","February","March","April","May","June","July","August","September","October","November","December"],month_short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],day_full:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],day_short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},labels:{dhx_cal_today_button:"Today",day_tab:"Day",week_tab:"Week",month_tab:"Month",new_event:"New event",icon_save:"Save",icon_cancel:"Cancel",icon_details:"Details",icon_edit:"Edit",icon_delete:"Delete",confirm_closing:"",confirm_deleting:"Event will be deleted permanently, are you sure?",section_description:"Description",section_time:"Time period",full_day:"Full day",confirm_recurring:"Do you want to edit the whole set of repeated events?",section_recurring:"Repeat event",button_recurring:"Disabled",button_recurring_open:"Enabled",agenda_tab:"Agenda",date:"Date",description:"Description",year_tab:"Year"}};scheduler.config={default_date:"%j %M %Y",month_date:"%F %Y",load_date:"%Y-%m-%d",week_date:"%l",day_date:"%D, %F %j",hour_date:"%H:%i",month_day:"%d",xml_date:"%m/%d/%Y %H:%i",api_date:"%d-%m-%Y %H:%i",hour_size_px:42,time_step:5,start_on_monday:1,first_hour:0,last_hour:24,readonly:false,drag_resize:1,drag_move:1,drag_create:1,dblclick_create:1,edit_on_create:1,details_on_create:0,click_form_details:0,server_utc:false,positive_closing:false,icons_edit:["icon_save","icon_cancel"],icons_select:["icon_details","icon_edit","icon_delete"],lightbox:{sections:[{name:"description",height:200,map_to:"text",type:"textarea",focus:true},{name:"time",height:72,type:"time",map_to:"auto"}]}};scheduler.templates={};scheduler.init_templates=function(){var B=scheduler.date.date_to_str;var C=scheduler.config;var A=function(E,D){for(var F in D){if(!E[F]){E[F]=D[F]}}};A(scheduler.templates,{day_date:B(C.default_date),month_date:B(C.month_date),week_date:function(E,D){return scheduler.templates.day_date(E)+" – "+scheduler.templates.day_date(scheduler.date.add(D,-1,"day"))},day_scale_date:B(C.default_date),month_scale_date:B(C.week_date),week_scale_date:B(C.day_date),hour_scale:B(C.hour_date),time_picker:B(C.hour_date),event_date:B(C.hour_date),month_day:B(C.month_day),xml_date:scheduler.date.str_to_date(C.xml_date,C.server_utc),load_format:B(C.load_date,C.server_utc),xml_format:B(C.xml_date,C.server_utc),api_date:scheduler.date.str_to_date(C.api_date),event_header:function(F,D,E){return scheduler.templates.event_date(F)+" - "+scheduler.templates.event_date(D)},event_text:function(F,D,E){return E.text},event_class:function(F,D,E){return""},month_date_class:function(D){return""},week_date_class:function(D){return""},event_bar_date:function(F,D,E){return scheduler.templates.event_date(F)+" "},event_bar_text:function(F,D,E){return E.text}});this.callEvent("onTemplatesReady",[])};scheduler.uid=function(){if(!this._seed){this._seed=(new Date).valueOf()}return this._seed++};scheduler._events={};scheduler.clearAll=function(){this._events={};this._loaded={};this.clear_view()};scheduler.addEvent=function(A,G,D,F,B){var C=A;if(arguments.length!=1){C=B||{};C.start_date=A;C.end_date=G;C.text=D;C.id=F}C.id=C.id||scheduler.uid();C.text=C.text||"";if(typeof C.start_date=="string"){C.start_date=this.templates.api_date(C.start_date)}if(typeof C.end_date=="string"){C.end_date=this.templates.api_date(C.end_date)}C._timed=this.is_one_day_event(C);var E=!this._events[C.id];this._events[C.id]=C;this.event_updated(C);if(!this._loading){this.callEvent(E?"onEventAdded":"onEventChanged",[C.id,C])}};scheduler.deleteEvent=function(C,A){var B=this._events[C];if(!A&&!this.callEvent("onBeforeEventDelete",[C,B])){return }if(B){delete this._events[C];this.unselect(C);this.event_updated(B)}};scheduler.getEvent=function(A){return this._events[A]};scheduler.setEvent=function(B,A){this._events[B]=A};scheduler.for_rendered=function(C,B){for(var A=this._rendered.length-1;A>=0;A--){if(this._rendered[A].getAttribute("event_id")==C){B(this._rendered[A],A)}}};scheduler.changeEventId=function(C,A){if(C==A){return }var B=this._events[C];if(B){B.id=A;this._events[A]=B;delete this._events[C]}this.for_rendered(C,function(D){D.setAttribute("event_id",A)});if(this._select_id==C){this._select_id=A}if(this._edit_id==C){this._edit_id=A}this.callEvent("onEventIdChange",[C,A])};(function(){var A=["text","Text","start_date","StartDate","end_date","EndDate"];var C=function(E){return function(F){return(scheduler.getEvent(F))[E]}};var D=function(E){return function(H,G){var F=scheduler.getEvent(H);F[E]=G;F._changed=true;F._timed=this.is_one_day_event(F);scheduler.event_updated(F,true)}};for(var B=0;Bthis._colsS.height-22){var N=B.rows[E].cells;for(var C=0;CJ.start_date?1:-1});var G=[];var I=[];for(var C=0;C(E.max_count||0)){E.max_count=E.length}}if(D=this.config.last_hour){I.push(F);H[C]=F=this._copy_event(F);if(D=this.config.last_hour){F.end_date.setMinutes(0);F.end_date.setHours(this.config.last_hour)}if(F.start_date>F.end_date||D==this.config.last_hour){H.splice(C,1);C--;continue}}}if(!A){for(var C=0;CB.start_date?1:-1})};scheduler._pre_render_events_table=function(P,C){this._time_order(P);var F=[];var A=[[],[],[],[],[],[],[]];var N=this._colsS.heights;var I;var M=this._cols.length;for(var G=0;Gthis._max_date){H=this._max_date}var E=this.locate_holder_day(J,false,L);L._sday=E%M;var O=this.locate_holder_day(H,true,L)||M;L._eday=(O%M)||M;L._length=O-E;L._sweek=Math.floor((this._correct_shift(J.valueOf(),1)-this._min_date.valueOf())/(60*60*1000*24*M));var K=A[L._sweek];var D;for(D=0;D"+L.text+"";if(this._quirks7){A.firstChild.style.height=O-12+"px"}this._editor=A.firstChild;this._editor.onkeypress=function(Q){if((Q||event).shiftKey){return true}var P=(Q||event).keyCode;if(P==scheduler.keys.edit_save){scheduler.editStop(true)}if(P==scheduler.keys.edit_cancel){scheduler.editStop(false)}};this._editor.onselectstart=function(P){return(P||event).cancelBubble=true};A.firstChild.focus();this._els.dhx_cal_data[0].scrollLeft=0;A.firstChild.select()}if(this._select_id==L.id){var N=this.config["icons_"+((this._edit_id==L.id)?"edit":"select")];var I="";for(var H=0;H