'),this.day_list=[],this.day_widgets=[],this.update_timer=null,this.resize_timer=null,this.setDOMNode(this.div[0])},destroy:function(){framework.getApplicationByName("calendar").tab&&$j(framework.getApplicationByName("calendar").tab.contentDiv).off("show."+this.id),this._super.apply(this,arguments),this._actionObject.clear(),this._actionObject.unregisterActions(),this._actionObject.remove(),this._actionObject=null,this.div.off(),this.div=null,this.gridHeader=null,this.dayHeader=null,this.days=null,this.scrolling=null,this._labelContainer=null,this.resize_timer&&window.clearTimeout(this.resize_timer)},doLoadingFinished:function(){this._super.apply(this,arguments),framework.getApplicationByName("calendar").tab&&$j(framework.getApplicationByName("calendar").tab.contentDiv).on("show."+this.id,jQuery.proxy(function(){this.scrolling&&this.scrolling.scrollTop(this._top_time)},this)),this.resize(),this._drawGrid(),this._link_actions(this.options.actions||this._parent.options.actions||[]);var timegrid=this;return this.div.on("mouseover",".calendar_calEvent:not(.ui-resizable):not(.rowNoEdit)",function(){if(0!==timegrid.options.granularity){timegrid._get_event_info(this);$j(this).resizable({distance:10,grid:[1e4,timegrid.rowHeight],autoHide:!1,handles:"s,se",containment:"parent",create:function(event,ui){var resizeHelper=event.target.getAttribute("data-resize");"WD"!=resizeHelper&&"WDS"!=resizeHelper||jQuery(this).resizable("destroy")},stop:function(event,ui){var e=new jQuery.Event("change");e.originalEvent=event,e.data={duration:0};var event_data=timegrid._get_event_info(this),event_widget=timegrid.getWidgetById(event_data.widget_id),sT=event_widget.options.value.start_m;if("undefined"!=typeof this.dropEnd&&1==this.dropEnd.length){var eT=parseInt(60*this.dropEnd.attr("data-hour"))+parseInt(this.dropEnd.attr("data-minute"));e.data.duration=(eT-sT)/60*3600,event_widget&&(event_widget.options.value.end_m=eT,event_widget.options.value.duration=e.data.duration),$j(this).trigger(e),event_widget._update(event_widget.options.value),$j(this).resizable("instance")&&$j(this).resizable("destroy")}event_widget&&event_widget._parent&&event_widget._parent.position_event(event_widget),timegrid.div.children(".drop-hover").removeClass(".drop-hover")},resize:function(event,ui){timegrid._get_time_from_position(ui.helper[0].getBoundingClientRect().left,ui.helper[0].getBoundingClientRect().bottom+5),timegrid.gridHover.hide();var drop=timegrid._drag_helper(this,ui.element[0]);drop&&!drop.is(":visible")&&drop.get(0).scrollIntoView(!1)}})}}),this.div.on("dragcreate",".calendar_calEvent",function(event,ui){$j(this).draggable("option","cancel",".rowNoEdit"),$j(this).draggable("option","cursorAt",{top:5,left:-5})}).on("dragstart",".calendar_calEvent",function(event,ui){$j(".calendar_calEvent",ui.helper).width($j(this).width()).height($j(this).outerHeight()).css("top","").css("left","").appendTo(ui.helper),ui.helper.width($j(this).width())}).on("mousemove",function(event){timegrid._get_time_from_position(event.clientX,event.clientY)}).on("mouseout",function(){timegrid.gridHover.hide()}),!0},_drag_helper:function(element,helper,height){if(element){if(element.dropEnd=this.gridHover,element.dropEnd.length&&(this._drop_data=element.dropEnd[0].dataset||{}),"undefined"!=typeof element.dropEnd&&element.dropEnd.length){this.gridHover.is(":visible")&&(this.scrolling.scrollTop()>0&&this.scrolling.scrollTop()>=this.gridHover.position().top-this.rowHeight?this.scrolling.scrollTop(this.gridHover.position().top-this.rowHeight):this.scrolling.scrollTop()+this.scrolling.height()<=this.gridHover.position().top+2*this.rowHeight&&this.scrolling.scrollTop(this.scrolling.scrollTop()+this.rowHeight));var time="";this._drop_data.whole_day?time=this.egw().lang("Whole day"):0===this.options.granularity?$j(helper).addClass("calendar_calTimeGridList"):time=jQuery.datepicker.formatTime("12"===egw.preference("timeformat")?"h:mmtt":"HH:mm",{hour:element.dropEnd.attr("data-hour"),minute:element.dropEnd.attr("data-minute"),seconds:0,timezone:0},{ampm:"12"==egw.preference("timeformat")}),element.innerHTML='
'+time+"
"}else element.innerHTML='
';return $j(element).width($j(helper).width()),element.dropEnd}},_event_drop:function(timegrid,event,ui,dropEnd){var e=new jQuery.Event("change");if(e.originalEvent=event,e.data={start:0},"undefined"!=typeof dropEnd&&dropEnd){var drop_date=dropEnd.date||!1,event_data=timegrid._get_event_info(ui.draggable),event_widget=timegrid.getWidgetById(event_data.widget_id);if(event_widget||(event_widget=timegrid.getParent().getWidgetById(event_data.widget_id)),event_widget){event_widget._parent.date_helper.set_year(drop_date.substring(0,4)),event_widget._parent.date_helper.set_month(drop_date.substring(4,6)),event_widget._parent.date_helper.set_date(drop_date.substring(6,8)),"calendar"==event_data.app&&event_widget.options.value.whole_day?(event_widget._parent.date_helper.set_hours(0),event_widget._parent.date_helper.set_minutes(0)):0===timegrid.options.granularity?(event_widget._parent.date_helper.set_hours(event_widget.options.value.start.getUTCHours()),event_widget._parent.date_helper.set_minutes(event_widget.options.value.start.getUTCMinutes())):(event_widget._parent.date_helper.set_hours(dropEnd.whole_day?0:dropEnd.hour||0),event_widget._parent.date_helper.set_minutes(dropEnd.whole_day?0:dropEnd.minute||0));var loading=ui.helper.clone(!0).appendTo($j("body"));0==$j(".calendar_timeDemo",loading).length?$j(".calendar_calEventHeader",loading).addClass("loading"):$j(".calendar_timeDemo",loading).after('
'),event_widget.recur_prompt(function(button_id){if("cancel"===button_id||!button_id){var app_id=event_widget.options.value.app_id?event_widget.options.value.app_id:event_widget.options.value.id+(event_widget.options.value.recur_type?":"+event_widget.options.value.recur_date:"");return egw().dataStoreUID("calendar::"+app_id,egw.dataGetUIDdata("calendar::"+app_id).data),void loading.remove()}if("infolog"===event_data.app){var duration=dropEnd.whole_day?86399:event_widget.options.value.whole_day?60*egw().preference("defaultlength","calendar"):!1;egw().json("stylite_infolog_calendar_integration::ajax_moveInfologEvent",[event_data.app_id,event_widget._parent.date_helper.getValue()||!1,duration],function(){loading.remove()}).sendRequest(!0)}else{var duration=event_widget.options.value.whole_day&&dropEnd.hour?86399:!1;dropEnd.whole_day&&(duration="whole_day");var _send=function(series_instance){var start=new Date(event_widget._parent.date_helper.getValue());egw().json("calendar.calendar_uiforms.ajax_moveEvent",["series"===button_id?event_data.id:event_data.app_id,event_data.owner,start,timegrid.options.owner||egw.user("account_id"),duration,series_instance],function(){loading.remove()}).sendRequest(!0)};event_widget.options.value.recur_type&&"series"===button_id?event_widget.series_split_prompt(function(_button_id){_button_id===et2_dialog.OK_BUTTON?_send(event_widget.options.value.recur_date):loading.remove()}):_send(event_widget.options.value.recur_date)}})}}},invalidate:function(trigger){this.day_list=[],this.update_timer&&window.clearTimeout(this.update_timer),this.update_timer=window.setTimeout(jQuery.proxy(function(){this.widget.update_timer=null,window.clearTimeout(this.resize_timer),this.widget.loader.hide().show(),this.widget._actionManager&&this.widget._link_actions(this.widget._actionManager.children),this.widget._drawDays(),this.widget._drawTimes(),this.trigger&&this.widget.change(),window.setTimeout(jQuery.proxy(function(){this.loader.hide()},this.widget),100)},{widget:this,trigger:trigger}),ET2_GRID_INVALIDATE_TIMEOUT)},detachFromDOM:function(){$j(this.div).off(".et2_calendar_timegrid"),this._super.apply(this,arguments)},attachToDOM:function(){this._super.apply(this,arguments),$j(this.div).on("change.et2_calendar_timegrid",".calendar_calEvent",this,function(e){var args=Array.prototype.slice.call(arguments);return-1==args.indexOf(this)&&args.push(this),e.data.event_change.apply(e.data,args)}),$j(this.div).on("change.et2_calendar_timegrid","*:not(.calendar_calEvent)",this,function(e){return e.data.change.call(e.data,e,this)}),this.div.on("resize",this,function(e){e.stopPropagation()})},getDOMNode:function(_sender){return _sender!==this&&_sender?_sender.instanceOf(et2_calendar_daycol)?this.days?this.days[0]:null:_sender?this.gridHeader?this.gridHeader[0]:null:void 0:this.div?this.div[0]:null},set_disabled:function(disabled){this._super.apply(this,arguments),disabled&&this.loader.show()},_drawGrid:function(){this.div.css("height",this.options.height).empty(),this.loader.prependTo(this.div).show(),this._drawTimes(),this.invalidate()},_drawTimes:function(){$j(".calendar_calTimeRow",this.div).remove(),this.div.toggleClass("calendar_calTimeGridList",0===this.options.granularity),this.gridHeader.attr("data-date",this.options.start_date).attr("data-owner",this.options.owner).append(this._labelContainer).append(this.owner.getDOMNode()).append(this.dayHeader).appendTo(this.div);Math.max(this.gridHeader.outerHeight(!0),18);if(this.scrolling.appendTo(this.div).off(),0===this.options.granularity)return this.scrolling.css("height","100%"),this.days.css("height","100%"),void this.iterateOver(function(day){day.resize()},this,et2_calendar_daycol);var wd_start=60*this.options.day_start,wd_end=60*this.options.day_end,granularity=this.options.granularity,totalDisplayMinutes=wd_end-wd_start,rowsToDisplay=Math.ceil((totalDisplayMinutes+60)/granularity),row_count=1440/this.options.granularity;this.scrolling.on("scroll",jQuery.proxy(this._scroll,this));(100/rowsToDisplay).toFixed(1);this.rowHeight=this.scrolling.height()/rowsToDisplay,this.rowHeight<5&&this.div.is(":visible")&&0===this.rowHeight&&(this.rowHeight=5);var show={5:[0,15,30,45],10:[0,30],15:[0,30],45:[0,15,30,45]},html="";parseInt(this.div.css("line-height"));this._top_time=0;for(var t=0,i=0;1440>t;t+=granularity,++i){html+='
';var time=jQuery.datepicker.formatTime("12"===egw.preference("timeformat")?"h:mmtt":"HH:mm",{hour:t/60,minute:t%60,seconds:0,timezone:0},{ampm:"12"===egw.preference("timeformat")});wd_start>=t&&t+granularity>wd_start&&(this._top_time=this.rowHeight*(i+1+(wd_start-(t+granularity))/granularity));var time_label=("undefined"==typeof show[granularity]?t%60===0:-1!==show[granularity].indexOf(t%60))?time:"";time_label&&"12"==egw.preference("timeformat")&&time_label.split(":")[0]<10&&(time_label=" "+time_label),html+='
'+time_label+"
\n"}$j(".calendar_calTimeLabels",this.scrolling).empty().height(this.rowHeight*i).append(html),this.days.css("height",this.rowHeight*i+"px"),this.gridHover.css("height",this.rowHeight),this.scrolling.scrollTop(this._top_time)},resizeTimes:function(){this.resize_timer&&window.clearTimeout(this.resize_timer),this.upate_timer||(this.resize_timer=window.setTimeout(jQuery.proxy(function(){this._resizeTimes&&(this.resize_timer=null,this._resizeTimes())},this),1))},_resizeTimes:function(){if(this.div.is(":visible")){var wd_start=60*this.options.day_start,wd_end=60*this.options.day_end,totalDisplayMinutes=wd_end-wd_start,rowsToDisplay=Math.ceil((totalDisplayMinutes+60)/this.options.granularity),row_count=1440/this.options.granularity,new_height=this.scrolling.height()/rowsToDisplay,old_height=this.rowHeight;this.rowHeight=new_height,$j(".calendar_calTimeLabels",this.scrolling).height(this.rowHeight*row_count),this.days.css("height",0===this.options.granularity?"100%":this.rowHeight*row_count+"px"),this._top_time=wd_start*this.rowHeight/this.options.granularity,this.scrolling.scrollTop(this._top_time),this.rowHeight!=old_height&&this.iterateOver(function(child){child!==this&&child.resize()},this,et2_IResizeable)}},_drawDays:function(){this.scrolling.append(this.days),0===this.day_list.length&&this.options.start_date&&this.options.end_date&&(this.day_list=this._calculate_day_list(this.options.start_date,this.options.end_date,this.options.show_weekend));var daily_owner=1===this.day_list.length&&this.options.owner.length>1&&this.options.owner.length<(parseInt(egw.preference("day_consolidate","calendar"))||6),daycols_needed=daily_owner?this.options.owner.length:this.day_list.length,day_width=Math.min($j(this.getInstanceManager().DOMContainer).width(),this.days.width())/daycols_needed;if(!day_width||!this.day_list){var dim=egw.getHiddenDimensions(this.days,!1);day_width=dim.w/Math.max(daycols_needed,1)}for(var add_index=0,before=!0;daycols_needed>this.day_widgets.length;){var existing_index=this.day_widgets[add_index]&&!daily_owner?this.day_list.indexOf(this.day_widgets[add_index].options.date):-1;before=existing_index>add_index;var day=et2_createWidget("calendar-daycol",{owner:this.options.owner,width:(before?0:day_width)+"px"},this);this.isInTree()&&day.doLoadingFinished(),-1!=existing_index&&parseInt(this.day_list[add_index])
daycols_needed;){for(;delete_index>1&&this.day_list.indexOf(this.day_widgets[delete_index].options.date)>-1;)delete_index--,before=!0;0>delete_index&&(delete_index=0),before&&this.day_widgets[delete_index].set_width("0px"),this.day_widgets[delete_index].div.hide(),this.day_widgets[delete_index].header.hide(),this.day_widgets[delete_index].destroy(),this.day_widgets.splice(delete_index--,1)}for(var i=0;i=this.date_helper.date.getTime()&&14>=i);return day_list},_link_actions:function(actions){var objectManager=egw_getObjectManager(this.getInstanceManager().app,!0,1);objectManager=objectManager.getObjectById(this.getInstanceManager().uniqueId,2)||objectManager;var parent=objectManager.getObjectById(this.id,1)||objectManager.getObjectById(this._parent.id,1)||objectManager;if(!parent)return void egw.debug("error","No parent objectManager found");for(var i=0;i0){parent=parent.children[i];break}}var widget_object=this._actionObject||parent.getObjectById(this.id),aoi=new et2_action_object_impl(this,this.getDOMNode());aoi.doTriggerEvent=function(_event,_data){var event=_data.event||!1;if(event&&!_data.ui.draggable.hasClass("rowNoEdit")){if("drop"===event.type){var dropEnd=!1,helper=$j(".calendar_d-n-d_timeCounter",_data.ui.helper)[0];helper&&helper.dropEnd&&helper.dropEnd.length>=1&&"undefined"!=typeof this.dropEnd&&this.dropEnd.length>=1&&(dropEnd=helper.dropEnd[0].dataset||!1),this.getWidget()._event_drop.call($j(".calendar_d-n-d_timeCounter",_data.ui.helper)[0],this.getWidget(),event,_data.ui,dropEnd)}var drag_listener=function(event,ui){aoi.getWidget()._drag_helper($j(".calendar_d-n-d_timeCounter",ui.helper)[0],ui.helper[0],0)},time=$j(".calendar_d-n-d_timeCounter",_data.ui.helper);switch(_event){case EGW_AI_DRAG_OVER:_data.ui.draggable.on("drag.et2_timegrid"+widget_object.id,drag_listener),_data.ui.draggable.on("dragend.et2_timegrid"+widget_object.id,function(){_data.ui.draggable.off("drag.et2_timegrid"+widget_object.id)}),$j(".calendar_calEventHeader",_data.ui.helper).css("top",""),$j(".calendar_calEventBody",_data.ui.helper).css("padding-top",""),time.length?time.data("count",time.data("count")+1):_data.ui.helper.prepend('
');break;case EGW_AI_DRAG_OUT:_data.ui.draggable.off("drag.et2_timegrid"+widget_object.id);var timegrid=aoi.getWidget();timegrid.gridHover.hide(),timegrid.scrolling.scrollTop(timegrid._top_time),time.data("count",time.data("count")-1),time.length&&time.data("count")<=0&&time.remove()}}},null==widget_object?widget_object=parent.insertObject(!1,new egwActionObject(this.id,parent,aoi,this._actionManager||parent.manager.getActionById(this.id)||parent.manager)):widget_object.setAOI(aoi),this._actionObject=widget_object,widget_object.clear(),widget_object.unregisterActions();var action_links=this._get_action_links(actions);this._init_links_dnd(widget_object.manager,action_links),widget_object.updateActionLinks(action_links)},_init_links_dnd:function(mgr,actionLinks){var self=this,drop_action=mgr.getActionById("egw_link_drop"),drag_action=mgr.getActionById("egw_link_drag");return!egw.link_get_registry(this.dataStorePrefix||"calendar","query")||egw.link_get_registry(this.dataStorePrefix||"calendar","title")?(drop_action&&(drop_action.remove(),actionLinks.indexOf(drop_action.id)>=0&&actionLinks.splice(actionLinks.indexOf(drop_action.id),1)),void(drag_action&&(drag_action.remove(),actionLinks.indexOf(drag_action.id)>=0&&actionLinks.splice(actionLinks.indexOf(drag_action.id),1)))):(null==drop_action&&(drop_action=mgr.addAction("drop","egw_link_drop",egw.lang("Create link"),egw.image("link"),function(action,source,target){for(var links=[],id="",i=0;i0&&label.trim().length<6||this.options.owner.length>1)},set_granularity:function(minutes){minutes=Math.max(0,minutes),this.options.granularity!==minutes?0===this.options.granularity||0===minutes?(this.options.granularity=minutes,this.invalidate()):(this.options.granularity=minutes,this._drawTimes()):this.update_timer||this.resizeTimes()},set_show_weekend:function(weekends){weekends=!!weekends,this.options.show_weekend!==weekends&&(this.options.show_weekend=weekends,this.isAttached()&&this.invalidate())},change:function(){if(this.onchange){if("function"==typeof this.onchange){var args=Array.prototype.slice.call(arguments);return-1==args.indexOf(this)&&args.push(this),this.onchange.apply(this,args)}return et2_compileLegacyJS(this.options.onchange,this,_node)()}},event_change:function(event,dom_node){if(this.onevent_change){var event_data=this._get_event_info(dom_node),event_widget=this.getWidgetById(event_data.widget_id);
-et2_calendar_event.recur_prompt(event_data,jQuery.proxy(function(button_id,event_data){if("cancel"===button_id)return!1;if("function"==typeof this.onevent_change){var args=Array.prototype.slice.call(arguments);return-1==args.indexOf(event_widget)&&args.push(event_widget),event.button_id=button_id,this.onevent_change.apply(this,[event,event_widget,button_id])}return et2_compileLegacyJS(this.options.onevent_change,event_widget,dom_node)()},this))}return!1},get_granularity:function(){return"undefined"==typeof this.options.granularity&&(this.options.granularity=egw.preference("interval","calendar")||30),parseInt(this.options.granularity)},click:function(_ev){var result=!0;if(_ev.target.dataset.id||$j(_ev.target).parents(".calendar_calEvent").length){var event=this._get_event_info(_ev.originalEvent.target);if("function"==typeof this.onclick){var args=Array.prototype.slice.call(arguments);-1==args.indexOf(this)&&args.splice(1,0,this),result=this.onclick.apply(this,args)}var event_node=$j(event.event_node);return event.id&&result&&!this.disabled&&!this.options.readonly&&event_node&&!event_node.hasClass("rowNoView")?(event.widget_id&&this.getWidgetById(event.widget_id)?this.getWidgetById(event.widget_id).recur_prompt():et2_calendar_event.recur_prompt(event),!1):result}if(this.gridHeader.is(_ev.target)&&_ev.target.dataset)app.calendar.update_state(jQuery.extend({view:"week"},_ev.target.dataset));else if(this.dayHeader.has(_ev.target).length)for(var i=1;ithis.options.height&&0!=this.options.granularity;if($j(this.getInstanceManager().DOMContainer).css({"overflow-y":too_small||_too_small?"auto":"hidden","overflow-x":"hidden",height:too_small||_too_small?height:"100%"}),too_small||_too_small){if(this.options.height=Math.max(this.options.height,needed),!_too_small&&rowCount>1&&this._parent)return void window.setTimeout(jQuery.proxy(function(){this._parent&&this._parent.iterateOver(function(widget){widget.disabled||widget.resize(!0)},this,et2_calendar_timegrid)},this),1);this.div.addClass("calendar_calTimeGridFixed")}else this.div.removeClass("calendar_calTimeGridFixed");this.div.css("height",this.options.height),this.update_timer||this.resizeTimes();for(var total_width=$j(this.getInstanceManager().DOMContainer).parent().innerWidth()-this.days.position().left,day_width=(total_width>0?total_width:$j(this.getInstanceManager().DOMContainer).width())/this.day_widgets.length,i=0;i'+this._get_timespan(event)+"
").append(''+title+""),jQuery.Color("rgba(0,0,0,0)").toRgbaString()!=jQuery.Color(this.div,"background-color").toRgbaString()&&this.div.css("border-color","calendar_calEventAllAccepted"===status_class?this.div.css("background-color"):""),this.icons.appendTo(this.title).html(this._icons()),event.whole_day_on_top)this.body.html(title);else{var start_time=jQuery.datepicker.formatTime("12"===egw.preference("timeformat")?"h:mmtt":"HH:mm",{hour:event.start_m/60,minute:event.start_m%60,seconds:0,timezone:0},{ampm:"12"===egw.preference("timeformat")}).trim();this.body.html(''+title+"").append(''+start_time+""),this.options.value.description.trim()&&this.body.append(""+this.options.value.description+"
")}this.set_statustext(""),this._parent.div.is(":visible")&&this._small_size()},_small_size:function(){if(!this.options.value.whole_day_on_top){this.div.removeClass("calendar_calEventSmall"),this.body.css("height","auto");var line_height=parseFloat(this.div.css("line-height")),visible_lines=Math.floor(this.div.innerHeight()/line_height);this.title.height()||(visible_lines=Math.floor(egw.getHiddenDimensions(this.div).h/egw.getHiddenDimensions(this.title).h)),visible_lines=Math.max(1,visible_lines),this.div.toggleClass("calendar_calEventSmall",4>visible_lines),this.div.attr("data-visible_lines",visible_lines),this.body.height()>this.div.height()-this.title.height()&&visible_lines>=4?this.body.css("height",Math.floor((visible_lines-1)*line_height-this.title.height())+"px"):this.body.css("height","")}},_status_class:function(){var status_class="calendar_calEventAllAccepted";for(var id in this.options.value.participants){var status=this.options.value.participants[id];switch(status=et2_calendar_event.split_status(status)){case"A":case"":break;case"U":return status_class="calendar_calEventSomeUnknown";default:status_class="calendar_calEventAllAnswered"}}return status_class},_tooltip:function(){if(!this.div)return"";var border=this.div.css("borderTopColor"),bg_color=this.div.css("background-color"),header_color=this.title.css("color"),timespan=this._get_timespan(this.options.value);this._parent.date_helper.set_value(this.options.value.start.valueOf?new Date(this.options.value.start):this.options.value.start);var start=this._parent.date_helper.input_date.val();this._parent.date_helper.set_value(this.options.value.end.valueOf?new Date(this.options.value.end):this.options.value.end);var end=this._parent.date_helper.input_date.val(),times=this.options.value.multiday?''+this.egw().lang("Start")+":"+start+''+this.egw().lang("End")+":"+end:''+this.egw().lang("Time")+":"+timespan,cat_label="";if(this.options.value.category){var cat=et2_createWidget("select-cat",{readonly:!0},this);cat.set_value(this.options.value.category),cat_label=this.options.value.category.indexOf(",")<=0?cat.span.text():[],"string"!=typeof cat_label&&(cat.span.children().each(function(){cat_label.push($j(this).text())}),cat_label=cat_label.join(", ")),cat.destroy()}return'"},_icons:function(){var icons=[];if(this.options.value.is_private)icons.push('');else{"calendar"!==this.options.value.app&&icons.push(''),3==this.options.value.priority&&icons.push(''),"0"==this.options.value.public&&icons.push(''),this.options.value.recur_type&&icons.push('');var single='',multiple='';for(var uid in this.options.value.participants){if(1==Object.keys(this.options.value.participants).length&&!isNaN(uid)){icons.push(single);break}isNaN(uid)||-1!==icons.indexOf(multiple)||icons.push(multiple)}this.options.value.non_blocking&&icons.push(''),!this.options.value.alarm||jQuery.isEmptyObject(this.options.value.alarm)||this.options.value.is_private||icons.push(''),this.options.value.participants[egw.user("account_id")]&&"U"==this.options.value.participants[egw.user("account_id")][0]&&icons.push('')}return icons},_get_timespan:function(event){var timespan="";if(0===event.start_m&&event.end_m>=1439)timespan=event.end_m>1440?jQuery.datepicker.formatTime("12"===egw.preference("timeformat")?"h:mmtt":"HH:mm",{hour:event.start_m/60,minute:event.start_m%60,seconds:0,timezone:0},{ampm:"12"===egw.preference("timeformat")}).trim()+" - "+jQuery.datepicker.formatTime("12"===egw.preference("timeformat")?"h:mmtt":"HH:mm",{hour:event.end_m/60,minute:event.end_m%60,seconds:0,timezone:0},{ampm:"12"===egw.preference("timeformat")}).trim():egw.lang("Whole day");else{var duration=event.multiday?(event.end-event.start)/6e4:event.end_m-event.start_m;1439===event.end_m&&++duration,duration=Math.floor(duration/60)+this.egw().lang("h")+(duration%60?duration%60:""),timespan=jQuery.datepicker.formatTime("12"===egw.preference("timeformat")?"h:mmtt":"HH:mm",{hour:event.start_m/60,minute:event.start_m%60,seconds:0,timezone:0},{ampm:"12"===egw.preference("timeformat")}).trim(),timespan+=" "+duration}return timespan},_values_check:function(event){event.id&&(event.id=""+event.id),"object"!=typeof event.start&&(this._parent.date_helper.set_value(event.start),event.start=new Date(this._parent.date_helper.getValue())),"object"!=typeof event.end&&(this._parent.date_helper.set_value(event.end),event.end=new Date(this._parent.date_helper.getValue())),"undefined"==typeof event.start_m&&(event.start_m=60*event.start.getUTCHours()+event.start.getUTCMinutes(),event.end_m=60*event.end.getUTCHours()+event.end.getUTCMinutes()),"undefined"==typeof event.multiday&&(event.multiday=event.start.getUTCFullYear()!==event.end.getUTCFullYear()||event.start.getUTCMonth()!==event.end.getUTCMonth()||event.start.getUTCDate()!=event.end.getUTCDate()),event.start.getUTCHours()||event.start.getUTCMinutes()||23!=event.end.getUTCHours()||59!=event.end.getUTCMinutes()||(event.whole_day_on_top=event.non_blocking&&"0"!=event.non_blocking)},_sameday_check:function(event){if(!this._parent||null===event)return!1;var owner_match=!0;if(event.participants&&this._parent.options.owner){var parent_owner="object"!=typeof this._parent.options.owner?[this._parent.options.owner]:this._parent.options.owner;owner_match=!1;for(var length=parent_owner.length,i=0;length>i;i++)parseInt(parent_owner[i])<0&&egw.accountData(parent_owner[i],"account_id",!0,function(members){parent_owner=parent_owner.concat(Object.keys(members))});for(var id in event.participants)if(this._parent.options.owner==id||parent_owner.indexOf&&parent_owner.indexOf(id)>=0){owner_match=!0;break}owner_match||(owner_match=this._parent.options.owner==event.owner||parent_owner.indexOf&&parent_owner.indexOf(event.owner)>=0)}if(owner_match&&this.options.value.date&&event.date==this.options.value.date)return!0;var event_start=new Date(event.start),event_end=new Date(event.end);if(owner_match&&this._parent.date>=event_start&&this._parent.date<=event_end)return!0;this._actionObject&&(this._actionObject.clear(),this._actionObject.unregisterActions(),this._actionObject=null);var new_cache_id=app.classes.calendar._daywise_cache_id(event.date,this._parent.options.owner),new_daywise=egw.dataGetUIDdata(new_cache_id);new_daywise=new_daywise&&new_daywise.data?new_daywise.data:[];var old_cache_id=!1;if(this.options.value&&this.options.value.date&&(old_cache_id=app.classes.calendar._daywise_cache_id(this.options.value.date,this._parent.options.owner)),new_cache_id!=old_cache_id){var old_daywise=egw.dataGetUIDdata(old_cache_id);old_daywise=old_daywise&&old_daywise.data?old_daywise.data:[],old_daywise.splice(old_daywise.indexOf(this.options.value.id),1),egw.dataStoreUID(old_cache_id,old_daywise),new_daywise.indexOf(event.id)<0&&new_daywise.push(event.id),null!==new_daywise.data&&egw.dataStoreUID(new_cache_id,new_daywise)}return!1},attachToDOM:function(){this._super.apply(this,arguments),this.onclick||$j(this.node).off("click")},click:function(_ev){var result=!0;if("function"==typeof this.onclick){var args=Array.prototype.slice.call(arguments);-1==args.indexOf(this)&&args.splice(1,0,this),result=this.onclick.apply(this,args)}return result},recur_prompt:function(callback,extra_data){et2_calendar_event.recur_prompt(this.options.value,callback,extra_data)},series_split_prompt:function(callback){et2_calendar_event.series_split_prompt(this.options.value,this.options.value.recur_date,callback)},_link_actions:function(actions){if(!this._actionObject){var objectManager=this.getParent().getParent()._actionObject||egw_getAppObjectManager(!0).getObjectById(this._parent._parent._parent.id)||egw_getAppObjectManager(!0);this._actionObject=objectManager.getObjectById("calendar::"+this.options.value.row_id)}null==this._actionObject?this._actionObject=objectManager.insertObject(!1,new egwActionObject("calendar::"+this.options.value.row_id,objectManager,new et2_event_action_object_impl(this,this.getDOMNode()),this._actionManager||objectManager.manager.getActionById("calendar::"+this.options.value.row_id)||objectManager.manager)):this._actionObject.setAOI(new et2_event_action_object_impl(this,this.getDOMNode())),this._actionObject.clear(),this._actionObject.unregisterActions();var action_links=this._get_action_links(actions);action_links.push("egw_link_drag"),action_links.push("egw_link_drop"),this._actionObject.updateActionLinks(action_links)},getDetachedAttributes:function(_attrs){},getDetachedNodes:function(){return[this.getDOMNode()]},setDetachedAttributes:function(_nodes,_values){}})}.call(this);et2_register_widget(et2_calendar_event,["calendar-event"]),et2_calendar_event.recur_prompt=function(event_data,callback,extra_data){var edit_id=event_data.app_id,edit_date=event_data.start,egw=this.egw?"function"==typeof this.egw?this.egw():this.egw:(window.opener||window).egw,that=this,extra_params=extra_data&&"object"==typeof extra_data?extra_data:{};if(extra_params.date=edit_date.toJSON?edit_date.toJSON():edit_date,"function"!=typeof callback&&(callback=function(_button_id){switch(_button_id){case"exception":extra_params.exception="1",egw.open(edit_id,event_data.app||"calendar","edit",extra_params);break;case"series":case"single":egw.open(edit_id,event_data.app||"calendar","edit",extra_params);break;case"cancel":}}),parseInt(event_data.recur_type)){var buttons=[{text:egw.lang("Edit exception"),id:"exception",class:"ui-priority-primary",default:!0},{text:egw.lang("Edit series"),id:"series"},{text:egw.lang("Cancel"),id:"cancel"}];et2_dialog.show_dialog(function(button_id){callback.call(that,button_id,event_data)},(event_data.is_private?egw.lang("private"):event_data.title)+"\n"+egw.lang("Do you want to edit this event as an exception or the whole series?"),egw.lang("This event is part of a series"),{},buttons,et2_dialog.QUESTION_MESSAGE)}else callback.call(this,"single",event_data)},et2_calendar_event.series_split_prompt=function(event_data,instance_date,callback){var egw=this.egw?"function"==typeof this.egw?this.egw():this.egw:(window.opener||window).egw,that=this;"string"==typeof instance_date&&(instance_date=new Date(instance_date));var tempDate=new Date,today=new Date(tempDate.getFullYear(),tempDate.getMonth(),tempDate.getDate(),tempDate.getHours(),-tempDate.getTimezoneOffset(),tempDate.getSeconds()),termination_date=today>instance_date?egw.lang("today"):date(egw.preference("dateformat"),instance_date);parseInt(event_data.recur_type)&&et2_dialog.show_dialog(function(button_id){callback.call(that,button_id,event_data)},(event_data.is_private?egw.lang("private"):event_data.title)+"\n"+egw.lang("Do you really want to change the start of this series? If you do, the original series will be terminated as of %1 and a new series for the future reflecting your changes will be created.",termination_date),egw.lang("This event is part of a series"),{},et2_dialog.BUTTONS_OK_CANCEL,et2_dialog.WARNING_MESSAGE)},et2_calendar_event.drag_helper=function(event,ui){ui.helper.width(ui.width())},et2_calendar_event.split_status=function(status,quantity,role){quantity=1,role="REQ-PARTICIPANT";var matches=null;return"string"==typeof status&&status.length>1&&(matches=status.match(/^.([0-9]*)(.*)$/gi)),matches?(parseInt(matches[1])>0&&(quantity=parseInt(matches[1])),matches[2]&&(role=matches[2]),status=status[0]):status===!0&&(status="U"),status};var et2_calendar_daycol=function(){"use strict";return et2_valueWidget.extend([et2_IDetachedDOM,et2_IResizeable],{attributes:{date:{name:"Date",type:"any",description:"What date is this daycol for. YYYYMMDD or Date",default:et2_no_init},owner:{name:"Owner",type:"any",default:et2_no_init,description:"Account ID number of the calendar owner, if not the current user"},display_birthday_as_event:{name:"Birthdays",type:"boolean",default:!1,description:"Display birthdays as events"},display_holiday_as_event:{name:"Holidays",type:"boolean",default:!1,description:"Display holidays as events"}},init:function(){this._super.apply(this,arguments),this.div=$j(document.createElement("div")).addClass("calendar_calDayCol").css("width",this.options.width).css("left",this.options.left),this.header=$j(document.createElement("div")).addClass("calendar_calDayColHeader").css("width",this.options.width).css("left",this.options.left),this.title=$j(document.createElement("div")).appendTo(this.header),this.all_day=$j(document.createElement("div")).addClass("calendar_calDayColAllDay").appendTo(this.header),this.event_wrapper=$j(document.createElement("div")).addClass("event_wrapper").appendTo(this.div),this.setDOMNode(this.div[0]),this.date_helper=et2_createWidget("date-time",{},null),this.date_helper.loadingFinished(),this.display_settings={wd_start:540,wd_end:1020,granularity:30,rowsToDisplay:10,rowHeight:20,titleHeight:2},this.registeredUID=null},doLoadingFinished:function(){if(this._super.apply(this,arguments),this._parent&&this._parent.options.owner&&this.set_owner(this._parent.options.owner),""===this.title.text()&&this.options.date&&this._parent&&this._parent.instanceOf(et2_calendar_timegrid)){var date=this.options.date;this.options.date="",this.set_date(date)}},destroy:function(){this._super.apply(this,arguments),this.div.off(),this.header.off().remove(),this.title.off(),this.div=null,this.header=null,this.title=null,this.date_helper.destroy(),this.date_helper=null,egw.dataUnregisterUID(this.registeredUID,!1,this)},getDOMNode:function(sender){return sender&&sender!==this?sender.instanceOf&&sender.instanceOf(et2_calendar_event)?0===this.display_settings.granularity?this.event_wrapper[0]:sender.options.value.whole_day_on_top||sender.options.value.whole_day&&sender.options.value.non_blocking===!0?this.all_day[0]:this.div[0]:void 0:this.div[0]},_draw:function(){if($j(".calendar_calAddEvent",this.div).remove(),this._parent&&this._parent.instanceOf(et2_calendar_timegrid)){this.display_settings.wd_start=60*this._parent.options.day_start,this.display_settings.wd_end=60*this._parent.options.day_end,this.display_settings.granularity=this._parent.options.granularity;for(var header=this._parent.dayHeader.children(),idx=0,siblings=this._parent.getDOMNode(this).childNodes;idx0;){var node=this._children[this._children.length-1];this.removeChild(node),node.free()}this.options.date=new_date,this.day_class_holiday(),this._draw(),this.registeredUID!==cache_id&&(this.registeredUID=cache_id,egw.dataRegisterUID(this.registeredUID,this._data_callback,this,this.getInstanceManager().execId,this.id))}},set_owner:function(_owner){if(this.title.attr("data-owner",_owner),this.header.attr("data-owner",_owner),_owner!==this.options.owner&&("object"!=typeof _owner&&"object"!=typeof this.options.owner||_owner.toString()!=this.options.owner.toString())){this.options.owner="object"!=typeof _owner?[_owner]:_owner;var cache_id=app.classes.calendar._daywise_cache_id(this.options.date,_owner);this.options.date&&this.registeredUID&&cache_id!==this.registeredUID&&egw.dataUnregisterUID(this.registeredUID,!1,this),this.registeredUID!==cache_id&&(this.registeredUID=cache_id,egw.dataRegisterUID(this.registeredUID,this._data_callback,this,this.getInstanceManager().execId,this.id))}},set_class:function(classnames){this.header.removeClass(this.class),this._super.apply(this,arguments),this.header.addClass(classnames)},_data_callback:function(event_ids){var events=[];null!=event_ids&&"undefined"!=typeof event_ids.length||(event_ids=[]);for(var i=0;i0;){var node=this._children[this._children.length-1];this.removeChild(node),node.free()}events.sort(function(a,b){var start=new Date(a.start)-new Date(b.start),end=new Date(a.end)-new Date(b.end);return a.whole_day&&b.whole_day?a.app_id-b.app_id:a.whole_day||b.whole_day?a.whole_day?-1:1:start?start:end});for(var c=0;c=elemBottom&&elemTop>=docViewTop)return!1;var visible={hidden:elemTop>docViewTop?"bottom":"top",completely:!1};return visible.completely="top"==visible.hidden?docViewTop>elemBottom:elemTop>docViewBottom,visible}this.header.children(".hiddenEventBefore").remove(),this.div.children(".hiddenEventAfter").remove(),this.event_wrapper.css("overflow","visible"),this.all_day.removeClass("overflown"),$j(".calendar_calEventBody",this.div).css({"padding-top":"","margin-top":""});var timegrid=this._parent;0===this.display_settings.granularity&&this._children.length&&($j("div.calendar_calEvent",this.div).show(0),Math.ceil(this.div.height()/this._children[0].div.height())>this._children.length)||(this.all_day.toggleClass("overflown",this.all_day[0].scrollHeight-this.all_day.height()>5),this.iterateOver(function(event){if(!this.display_settings.granularity||event.options&&event.options.value&&!event.options.value.whole_day_on_top){event.title.css({top:"","background-color":""}),event.body.css({"padding-top":"","margin-top":""});var hidden=isHidden.call(this,event.div),day=this;if(hidden)if("top"!==hidden.hidden||hidden.completely)0===this.display_settings.granularity&&hidden?(0==$j(".hiddenEventAfter",this.div).length&&this.event_wrapper.css("overflow","hidden"),this._hidden_indicator(event,!1,function(){app.calendar.update_state({view:"day",date:day.date})}),event.div.hide(0)):hidden.completely&&this._hidden_indicator(event,"top"==hidden.hidden,!1);else{var title_height=event.title.outerHeight();event.title.css({top:timegrid.scrolling.scrollTop()-event.div.position().top,"background-color":"transparent"}),event.body.css({"padding-top":timegrid.scrolling.scrollTop()-event.div.position().top+title_height,"margin-top":-title_height})}}},this,et2_calendar_event))},_hidden_indicator:function(event,top,onclick){var indicator="",day=this,timegrid=this._parent,fixed_height=timegrid.div.hasClass("calendar_calTimeGridFixed");if(top)0===$j(".hiddenEventBefore",this.header).length?(indicator=$j('').appendTo(this.header).attr("data-hidden_count",1),fixed_height||indicator.text(event.options.value.title).on("click","function"==typeof onclick?onclick:function(){return $j(".calendar_calEvent",day.div).first()[0].scrollIntoView(),!1})):(indicator=$j(".hiddenEventBefore",this.header),indicator.attr("data-hidden_count",parseInt(indicator.attr("data-hidden_count"))+1),fixed_height||indicator.text(day.egw().lang("%1 event(s) %2",indicator.attr("data-hidden_count"),"")));else{indicator=$j(".hiddenEventAfter",this.div),0===indicator.length&&(indicator=$j('').attr("data-hidden_count",0).appendTo(this.div),fixed_height?indicator.on("mouseover",function(){indicator.css({height:1.2*indicator.attr("data-hidden_count")+"em","margin-top":-(1.2*indicator.attr("data-hidden_count"))+"em"})}).on("mouseout",function(){indicator.css({height:"","margin-top":""})}):indicator.on("click","function"==typeof onclick?onclick:function(){return $j(".calendar_calEvent",day.div).last()[0].scrollIntoView(!1),day._out_of_view(),!1}));var count=parseInt(indicator.attr("data-hidden_count"))+1;indicator.attr("data-hidden_count",count),0===this.display_settings.granularity?(indicator.append(event.div.clone()),indicator.attr("data-hidden_label",day.egw().lang("%1 event(s) %2",indicator.attr("data-hidden_count"),""))):fixed_height||indicator.text(day.egw().lang("%1 event(s) %2",indicator.attr("data-hidden_count"),"")),indicator.css("top",timegrid.scrolling.height()+timegrid.scrolling.scrollTop()-indicator.innerHeight())}if(fixed_height&&indicator.append(""+event.options.value.title+"
"),""!==indicator){var color=jQuery.Color(event.div.css("background-color")).toString()!==jQuery.Color("white").toString()?event.div.css("background-color"):event.div.css("border-bottom-color");"rgba(0, 0, 0, 0)"!==color&&indicator.css("border-color",color)}},_spread_events:function(){if(!this.date)return[];var day_start=this.date.valueOf()/1e3,dst_check=new Date(this.date);dst_check.setUTCHours(12);var daylight_diff=day_start+43200-dst_check.valueOf()/1e3;daylight_diff&&(day_start-=daylight_diff);var eventCols=[],col_ends=[];this._children.sort(function(a,b){var start=new Date(a.options.value.start)-new Date(b.options.value.start),end=new Date(a.options.value.end)-new Date(b.options.value.end);if(a.options.value.whole_day&&b.options.value.whole_day){var duration=new Date(b.options.value.end)-new Date(b.options.value.start)-(new Date(a.options.value.end)-new Date(a.options.value.start));return duration?duration:a.options.value.app_id-b.options.value.app_id}return a.options.value.whole_day||b.options.value.whole_day?a.options.value.whole_day?-1:1:start?start:end});for(var i=0;i=this.date||new Date(event.end)<=this.date))this._children[i].destroy(),this.removeChild(this._children[i]);else{var c=0;if(event.multiday=!1,"object"!=typeof event.start&&(event.start=new Date(event.start)),"object"!=typeof event.end&&(event.end=new Date(event.end)),event.start_m=parseInt((event.start.valueOf()/1e3-day_start)/60),event.start_m<0&&(event.start_m=0,event.multiday=!0),event.end_m=parseInt((event.end.valueOf()/1e3-day_start)/60),event.end_m>=1440&&(event.end_m=1439,event.multiday=!0),event.start.getUTCHours()||event.start.getUTCMinutes()||23!=event.end.getUTCHours()||59!=event.end.getUTCMinutes()||(event.whole_day_on_top=event.non_blocking&&"0"!=event.non_blocking),!event.whole_day_on_top){for(c=0;event.start_m=0||!event)&&i=0||!event){if(columns[c][i].div.css("top",top+"%"),columns[c][i].div.css("height",height+"%"),columns[c][i].div.is(":visible")){var border_diff=columns[c][i].div.outerHeight()-columns[c][i].div.height();columns[c][i].div.css("height",columns[c][i].div.height()-border_diff)}columns[c][i].div.css("left",left.toFixed(1)+"%"),columns[c][i].div.css("right",right.toFixed(1)+"%"),columns[c][i].div.css("z-index",parseInt(20)+c),columns[c][i]._small_size()}}else this.all_day.has(columns[c][i].div).length&&columns[c][i].div.prependTo(this.event_wrapper),columns[c][i].div.css("top",""),columns[c][i].div.css("height",""),columns[c][i].div.css("left",""),columns[c][i].div.css("right",""),columns[c][i].body.css("padding-top","")}if(event&&columns[c].indexOf(event)>=0)return}},_time_to_position:function(time){var pos=0;return pos=time/60/24*100,pos=pos.toFixed(1)},attachToDOM:function(){this._super.apply(this,arguments),this.onclick||$j(this.node).off("click"),$j(this.node).on("click.et2_daycol",".calendar_calDayColHeader,.calendar_calAddEvent",jQuery.proxy(this.click,this))},click:function(_ev){if(this.title.is(_ev.target))return app.calendar.update_state({view:"day",date:this.date.toJSON()}),!1;if($j(_ev.target).hasClass("calendar_calAddEvent")&&!_ev.target.dataset.whole_day){var options={date:_ev.target.dataset.date||this.options.date,hour:_ev.target.dataset.hour||this._parent.options.day_start,minute:_ev.target.dataset.minute||0};return this.options.owner!=app.calendar.state.owner&&(options.owner=this.options.owner),this.egw().open(null,"calendar","add",options,"_blank"),!1}if(this.header.has(_ev.target).length&&!$j(".hiddenEventBefore",this.header).has(_ev.target)||this.header.is(_ev.target)){var end=this.date.getFullYear()+"-"+(this.date.getUTCMonth()+1)+"-"+this.date.getUTCDate()+"T23:59";return this.egw().open(null,"calendar","add",{start:this.date.toJSON(),end:end,non_blocking:!0},"_blank"),!1}},getDetachedAttributes:function(_attrs){},getDetachedNodes:function(){return[this.getDOMNode()]},setDetachedAttributes:function(_nodes,_values){},resize:function(){this.disabled||!this.div.is(":visible")||this._parent.disabled||(this.display_settings.granularity!==this._parent.options.granularity&&this._draw(),this.position_event(),this._out_of_view())}})}.call(this);et2_register_widget(et2_calendar_daycol,["calendar-daycol"]);var et2_calendar_planner_row=function(){"use strict";return et2_valueWidget.extend([et2_IDetachedDOM],{attributes:{start_date:{name:"Start date",type:"any"},end_date:{name:"End date",type:"any"},value:{type:"any"}},init:function(){this._super.apply(this,arguments),this.div=$j(document.createElement("div")).addClass("calendar_plannerRowWidget").css("width",this.options.width),this.title=$j(document.createElement("div")).addClass("calendar_plannerRowHeader").appendTo(this.div),this.rows=$j(document.createElement("div")).addClass("calendar_eventRows").appendTo(this.div),this.setDOMNode(this.div[0]),this.date_helper=et2_createWidget("date-time",{},null),this.date_helper.loadingFinished(),this.set_start_date(this.options.start_date),this.set_end_date(this.options.end_date)},doLoadingFinished:function(){return this._super.apply(this,arguments),this.set_label(this.options.label),this._draw(),!0},destroy:function(){this._super.apply(this,arguments),this.date_helper.destroy(),this.date_helper=null},getDOMNode:function(_sender){return _sender!==this&&_sender?_sender._parent===this?this.rows[0]:void 0:this.div[0]},_draw:function(){this.rows.remove(".calendar_eventRowsMarkedDay,.calendar_eventRowsFiller").nextAll().remove();var days=31,width=85;"month"===this._parent.options.group_by&&(days=new Date(this.options.end_date.getUTCFullYear(),this.options.end_date.getUTCMonth()+1,0).getUTCDate(),31>days&&(width=85*days/31,this.rows.css("width",width+"%"))),"month"==this._parent.options.group_by&&this.rows.append(this._yearlyPlannerMarkDays(this.options.start_date,days)),"month"===this._parent.options.group_by&&31>days&&this.rows.after('')},set_label:function(label){this.options.label=label,this.title.text(label),"month"===this._parent.options.group_by?(this.title.attr("data-date",this.options.start_date.toJSON()),this.title.addClass("et2_clickable et2_link")):(this.title.attr("data-date",""),this.title.removeClass("et2_clickable"))},set_start_date:function(new_date){if(!new_date||null===new_date)throw exception("Invalid end date. "+new_date.toString());this.options.start_date=new Date("string"==typeof new_date?new_date:new_date.toJSON()),this.options.start_date.setUTCHours(0),this.options.start_date.setUTCMinutes(0),this.options.start_date.setUTCSeconds(0)},set_end_date:function(new_date){if(!new_date||null===new_date)throw exception("Invalid end date. "+new_date.toString());this.options.end_date=new Date("string"==typeof new_date?new_date:new_date.toJSON()),this.options.end_date.setUTCHours(23),this.options.end_date.setUTCMinutes(59),this.options.end_date.setUTCSeconds(59)},_yearlyPlannerMarkDays:function(start,days){for(var day_width=100/days,t=new Date(start),content="",i=0;days>i;i++){var holidays=[],day_class=this._parent.day_class_holiday(t,holidays);day_class&&(content+='"),t.setUTCDate(t.getUTCDate()+1)}return content},_update_events:function(events){for(;this._children.length;)this._children[this._children.length-1].free(),this.removeChild(this._children[this._children.length-1]);this._cached_rows=[];for(var c=0;c ').appendTo(this.rows),height=rows.length*(parseInt(window.getComputedStyle(row[0]).getPropertyValue("height"))||20);row.remove();for(var c=0;c