egroupware/calendar/js/app.min.js

15 lines
172 KiB
JavaScript
Raw Normal View History

/*!
* EGroupware (http://www.egroupware.org/) minified Javascript
*
* full sources are available under https://svn.stylite.de/viewvc/egroupware/
*
* build Wed Mar 02 2016 15:24:00
*/
function et2_event_action_object_impl(widget,node){var aoi=new et2_action_object_impl(widget,node);return aoi.doSetState=function(_state,_outerCall){},aoi}var et2_calendar_owner=function(){"use strict";return et2_taglist_email.extend({attributes:{autocomplete_url:{default:"calendar_owner_etemplate_widget::ajax_owner"},autocomplete_params:{name:"Autocomplete parameters",type:"any",default:{},description:"Extra parameters passed to autocomplete URL. It should be a stringified JSON object."},allowFreeEntries:{default:!1,ignore:!0},select_options:{type:"any",name:"Select options",default:{},description:"Internally used to hold the select options."}},lib_options:{autoSelect:!1,groupBy:"app",minChars:2,selectFirst:!0,toggleOnClick:!0},doLoadingFinished:function(){this._super.apply(this,arguments);var widget=this;return this._oldValue=this.taglist.getValue(),this.$taglist.on("focus",function(){widget.taglist.expand()}).on("load expand",function(){window.setTimeout(function(){widget&&widget.div&&widget.div.find(".ms-res-item-active").removeClass("ms-res-item-active")},1)}),!0},getValue:function(){return null==this.taglist?null:this.taglist.getValue()}})}.call(this);et2_register_widget(et2_calendar_owner,["calendar-owner"]);var et2_calendar_view=function(){"use strict";return et2_valueWidget.extend({createNamespace:!0,attributes:{owner:{name:"Owner",type:"any",default:[egw.user("account_id")],description:"Account ID number of the calendar owner, if not the current user"},start_date:{name:"Start date",type:"any"},end_date:{name:"End date",type:"any"}},init:function(){this._super.apply(this,arguments),this.date_helper=et2_createWidget("date-time",{},null),this.date_helper.loadingFinished(),this.loader=$j('<div class="egw-loading-prompt-container ui-front loading"></div>'),this.update_timer=null},destroy:function(){this._super.apply(this,arguments),this.date_helper.destroy(),this.date_helper=null,this.update_timer&&window.clearTimeout(this.update_timer)},doLoadingFinished:function(){this._super.apply(this,arguments),this.loader.hide(0).prependTo(this.div),this.options.owner&&this.set_owner(this.options.owner)},invalidate:function(trigger_event){},get_start_date:function(){return new Date(this.options.start_date)},get_end_date:function(){return new Date(this.options.end_date)},set_start_date:function(new_date){new_date&&null!==new_date||(new_date=new Date),"object"==typeof new_date||"string"==typeof new_date&&new_date.length>8?this.date_helper.set_value(new_date):"string"==typeof new_date&&(this.date_helper.set_year(new_date.substring(0,4)),this.date_helper.set_month(new_date.substring(4,6)),this.date_helper.set_date(new_date.substring(6,8)));var old_date=this.options.start_date;this.options.start_date=new Date(this.date_helper.getValue()),old_date!==this.options.start_date&&this.isAttached()&&this.invalidate(!0)},set_end_date:function(new_date){new_date&&null!==new_date||(new_date=new Date),"object"==typeof new_date||"string"==typeof new_date&&new_date.length>8?this.date_helper.set_value(new_date):"string"==typeof new_date&&(this.date_helper.set_year(new_date.substring(0,4)),this.date_helper.set_month(new_date.substring(4,6)),this.date_helper.set_date(new_date.substring(6,8)));var old_date=this.options.end_date;this.options.end_date=new Date(this.date_helper.getValue()),old_date!==this.options.end_date&&this.isAttached()&&this.invalidate(!0)},set_owner:function(_owner){var old=this.options.owner;"0"==_owner&&(_owner=[egw.user("account_id")]),_owner=jQuery.isArray(_owner)?jQuery.extend([],_owner):"string"==typeof _owner?_owner.split(","):[_owner],this.options.owner=_owner,old!==this.options.owner&&this.isAttached()&&this.invalidate(!0)},set_value:function(events){return"object"!=typeof events?!1:((events.length&&events.length>0||!jQuery.isEmptyObject(events))&&this.set_disabled(!1),events.id&&(this.set_id(events.id),delete events.id),events.start_date&&(this.set_start_date(events.start_date),delete events.start_date),events.end_date&&(this.set_end_date(events.end_date),delete events.end_date),events.owner&&(this.set_owner(events.ow
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;i<this._children.length;i++)if(this._children[i].header&&(this._children[i].header.has(_ev.target).length||this._children[i].header.is(_ev.target)))return this._children[i].click(_ev)},_get_time_from_position:function(x,y){if(x=Math.round(x),y=Math.round(y),0===this.options.granularity)return $j(".calendar_calDayCol",this.div);var path=[],day=null,time=null;for(var id in this.gridHover[0].dataset)delete this.gridHover[0].dataset[id];for(var node=document.elementFromPoint(x,y);node&&node!=this.node&&"BODY"!=node.tagName&&path.length<10;){path.push(node),node.style.display="none";var $node=$j(node);if($node.hasClass("calendar_calDayColHeader")){for(var id in node.dataset)this.gridHover[0].dataset[id]=node.dataset[id];this.gridHover.css({position:"absolute",top:"",bottom:"0px",height:$node.css("padding-bottom")}),day=node;break}if($node.hasClass("calendar_calDayCol")&&(day=node,this.gridHover.attr("data-date",day.dataset.date)),$node.hasClass("calendar_calTimeRowTime")){time=node,this.gridHover.attr("data-hour",time.dataset.hour).attr("data-minute",time.dataset.minute);break}node=document.elementFromPoint(x,y)}for(var i=0;i<path.length;i++)path[i].style.display="";return day?(this.gridHover.show().appendTo(day),time&&this.gridHover.height(this.rowHeight).position({my:"left top",at:"left top",of:time}),this.gridHover.css("left",""),this.gridHover):[]},getDetachedAttributes:function(_attrs){_attrs.push("start_date","end_date")},getDetachedNodes:function(){return[this.getDOMNode()]},setDetachedAttributes:function(_nodes,_values){this.div=$j(_nodes[0]),_values.start_date&&this.set_start_date(_values.start_date),_values.end_date&&this.set_end_date(_values.end_date)},resize:function(_too_small){if(!this.disabled&&this.div.is(":visible")){var rowCount=0;this._parent.iterateOver(function(widget){widget.disabled||rowCount++},this,et2_calendar_timegrid);var height=$j(this.getInstanceManager().DOMContainer).parent().innerHeight();height-=$j("#calendar-toolbar",this.div.parents(".egw_fw_ui_tab_content")).outerHeight(!0),this.options.height=Math.floor(height/rowCount),this.options.height-=2*(this.div.outerWidth(!0)-this.div.innerWidth()+parseInt(this.div.parent().css("padding-top")));var needed=(this.day_end-this.day_start)/(this.options.granularity/60)*parseInt(this.div.css("line-height"))+this.gridHeader.outerHeight(),too_small=needed>this.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=
}this._out_of_view()},_out_of_view:function(){function isHidden(elem){var docViewTop=timegrid.scrolling.scrollTop(),docViewBottom=docViewTop+(0===this.display_settings.granularity?this.event_wrapper.height():timegrid.scrolling.height()),elemTop=elem.position().top,elemBottom=elemTop+elem.outerHeight(!0);if(docViewBottom>=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('<div class="hiddenEventBefore"></div>').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('<div class="hiddenEventAfter"></div>').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("<div id='"+event.dom_id+"' data-id='"+event.options.value.id+"'>"+event.options.value.title+"</div>"),""!==indicator){var color=jQuery.Color(event.di
for(var t=new Date(start.valueOf()),left=0,i=0;days>i;t.setUTCDate(1),t.setUTCMonth(t.getUTCMonth()+1),left+=days_in_month*day_width,i+=days_in_month){var u=new Date(t.getUTCFullYear(),t.getUTCMonth()+1,0,-t.getTimezoneOffset()/60);days_in_month=1+(u-t)/864e5;var first=new Date(t.getUTCFullYear(),t.getUTCMonth(),1,-t.getTimezoneOffset()/60);if(0>=days_in_month)break;i+days_in_month>days&&(days_in_month=days-i);var title=app.calendar.egw.lang(date("F",new Date(t.valueOf()+60*t.getTimezoneOffset()*1e3)));days_in_month>10?title+=" "+t.getUTCFullYear():5>days_in_month&&(title="&nbsp;"),content+='<div class="calendar_plannerMonthScale et2_clickable et2_link" data-date="'+first.toJSON()+'" data-planner_view="month" style="left: '+left+"%; width: "+day_width*days_in_month+'%;">'+title+"</div>"}return content+="</div>"},_header_weeks:function(start,days){for(var content='<div class="calendar_plannerScale" data-planner_view="week">',state="",t=new Date(start.valueOf()),week_end=app.calendar.date.end_of_week(start),days_in_week=Math.floor((week_end-start)/864e5+1),week_width=100/days*(7>=days?days:days_in_week),left=0,i=0;days>i;t.setUTCDate(t.getUTCDate()+7),left+=week_width){7>days-i&&(days_in_week=days-i);var usertime=new Date(t.valueOf());start.getTimezoneOffset()<0&&usertime.setUTCMinutes(usertime.getUTCMinutes()-start.getTimezoneOffset()),week_width=100/days*Math.min(days,days_in_week);var title=app.calendar.egw.lang("Week")+" "+app.calendar.date.week_number(usertime);start.getTimezoneOffset()>0&&usertime.setUTCMinutes(usertime.getUTCMinutes()+start.getTimezoneOffset()),state=app.calendar.date.start_of_week(usertime),state.setUTCHours(0),state.setUTCMinutes(0),state=state.toJSON(),(days_in_week>1||1==days)&&(content+='<div class="calendar_plannerWeekScale et2_clickable et2_link" data-date=\''+state+"' style=\"left: "+left+"%; width: "+week_width+'%;">'+title+"</div>"),i+=days_in_week,7!=days_in_week&&(t.setUTCDate(t.getUTCDate()-(7-days_in_week)),days_in_week=7)}return content+="</div>"},_header_days:function(start,days){for(var day_width=100/days,content='<div class="calendar_plannerScale'+(days>3?"Day":"")+'" data-planner_view="day" >',t=new Date(start.valueOf()+60*start.getTimezoneOffset()*1e3),left=0,i=0;days>i;t.setDate(t.getDate()+1),left+=day_width,++i){var holidays=[],tempDate=new Date(t);tempDate.setMinutes(tempDate.getMinutes()-start.getTimezoneOffset());var day_class=this.day_class_holiday(tempDate,holidays),title="",state="";title=3>=days?app.calendar.egw.lang(date("l",t))+", "+date("j",t)+". "+app.calendar.egw.lang(date("F",t)):7>=days?app.calendar.egw.lang(date("l",t))+" "+date("j",t):app.calendar.egw.lang(date("D",t)).substr(0,2)+"<br />"+date("j",t),state=new Date(t.valueOf()-60*start.getTimezoneOffset()*1e3).toJSON(),content+='<div class="calendar_plannerDayScale et2_clickable et2_link '+day_class+"\" data-date='"+state+"' style=\"left: "+left+"%; width: "+day_width+'%;"'+(holidays?' title="'+holidays.join(",")+'"':"")+">"+title+"</div>\n"}return content+="</div>"},_header_hours:function(start,days){for(var divisors=[1,2,3,4,6,8,12],decr=1,i=0;i<divisors.length&&!(divisors[i]>days);i++)decr=divisors[i];var hours=24*days;if(1===days){var t=new Date(start.getUTCFullYear(),start.getUTCMonth(),start.getUTCDate(),-start.getTimezoneOffset()/60),s=new Date(start);s.setUTCHours(23),s.setUTCMinutes(59),s.setUTCSeconds(59),hours=Math.ceil((s.getTime()-t.getTime())/36e5)}for(var cell_width=100/hours*decr,content='<div class="calendar_plannerScale" data-planner_view="day">',t=new Date(start.valueOf()+60*start.getTimezoneOffset()*1e3),left=0,i=0;hours>i;left+=cell_width,i+=decr){var title=date(12==egw.preference("timeformat","calendar")?"ha":"H",t);content+='<div class="calendar_plannerHourScale et2_link" data-date="'+t.toJSON()+'" style="left: '+left+"%; width: "+cell_width+'%;">'+title+"</div>",t.setHours(t.getHours()+decr)}return content+="</div>"},day_class_holiday:function(date,holiday_list){if(!date)return"";var day_class="",holidays=et2_calendar_view.get_holidays(this,date.getUTCFullYear());this.date_helper.set_v
if(exceptions){var buttons=[{button_id:"keep",title:this.egw.lang("All exceptions are converted into single events."),text:this.egw.lang("Keep exceptions"),id:"button[delete_keep_exceptions]",image:"keep",default:!0},{button_id:"delete",title:this.egw.lang("The exceptions are deleted together with the series."),text:this.egw.lang("Delete exceptions"),id:"button[delete_exceptions]",image:"delete"},{button_id:"cancel",text:this.egw.lang("Cancel"),id:"dialog[cancel]",image:"cancel"}];et2_dialog.show_dialog(function(_button_id){return"dialog[cancel]"!=_button_id?(widget.getRoot().getWidgetById("delete_exceptions").set_value("button[delete_exceptions]"==_button_id),widget.getInstanceManager().submit("button[delete]"),!0):!1},this.egw.lang("Do you want to keep the series exceptions in your calendar?"),this.egw.lang("This event is part of a series"),{},buttons,et2_dialog.WARNING_MESSAGE)}else 0!==content.recur_type?et2_dialog.confirm(widget,"Delete this series of recuring events","Delete Series"):et2_dialog.confirm(widget,"Delete this event","Delete")},print_participants_status:function(_event,widget){if(widget&&window.opener){var editPopWindow=window.opener;editPopWindow&&editPopWindow.etemplate2.getByApplication("calendar")[0].widgetContainer.getWidgetById(widget.id).set_value(widget.get_value()),this.et2._inst.submit(),editPopWindow.opener.egw_refresh("status changed","calendar")}else widget&&window.egw_refresh(this.egw.lang("The original popup edit window is closed! You need to close the print window and reopen the entry again."),"calendar")},edit_participant_search:function(request,widget){if("resources"==widget.app_select.val()){var values=widget.getInstanceManager().getValues(widget.getRoot());"object"==typeof request.options&&null!=request.options||(request.options={}),request.options.exec={start:values.start,end:values.end,duration:values.duration,participants:values.participants,recur_type:values.recur_type,event_id:values.link_to.to_id,show_conflict:"resources_without_conflict"==egw.preference("defaultresource_sel","calendar")?"0":"1"},values.whole_day&&(request.options.exec.whole_date=!0)}return!0},freetime_select:function(_event,_widget){if(_widget){var content=this.et2._inst.widgetContainer.getArrayMgr("content").data,selectedId=_widget.id.match(/^select\[([0-9])\]$/i)[1],sTime=this.et2.getWidgetById(selectedId+"start");if(window.opener&&sTime){var editWindowObj=window.opener.etemplate2.getByApplication("calendar")[0];if("undefined"!=typeof editWindowObj){var startTime=editWindowObj.widgetContainer.getWidgetById("start"),endTime=editWindowObj.widgetContainer.getWidgetById("end");startTime&&endTime&&(startTime.set_value(sTime.get_value()),endTime.set_value(sTime.get_value()),endTime.set_value("+"+content.duration))}}else alert(this.egw.lang("The original calendar edit popup is closed!"))}egw(window).close()},filter_change:function(){var view=app.classes.calendar.views.listview.etemplates[0].widgetContainer||!1,filter=view?view.getWidgetById("nm").getWidgetById("filter"):null,dates=view?view.getWidgetById("calendar.list.dates"):null;filter?app.calendar.state.filter=filter.getValue():delete app.calendar.state.filter,filter&&dates&&(dates.set_disabled("custom"!==filter.value),"custom"==filter.value&&jQuery(view.getWidgetById("startdate").getDOMNode()).find("input").focus())},action_open:function(_action,_events){var id=_events[0].id.split("::");if(_action.data.open){var open=JSON.parse(_action.data.open)||{},extra=open.extra||"";if(extra=extra.replace(/(\$|%24)app/,id[0]).replace(/(\$|%24)id/,id[1]),!extra){var context={};egw.dataGetUIDdata(_events[0].id)&&egw.dataGetUIDdata(_events[0].id).data?(context=egw.dataGetUIDdata(_events[0].id).data,extra={}):_events[0].iface.getWidget()&&_events[0].iface.getWidget().instanceOf(et2_valueWidget)&&(context=_events[0].iface.getWidget().getValue?_events[0].iface.getWidget().getValue():_events[0].iface.getWidget().options.value||{},extra={}),context.date&&(extra.date=context.date),context.app&&(extra.app=context.app),context.app_id&&(extra.app_id=context.app_id)}this.egw.open(ope
date.getUTCFullYear()+"-"+sprintf("%02d",date.getUTCMonth()+1)+"-"+sprintf("%02d",date.getUTCDate())+"T"+sprintf("%02d",date.getUTCHours())+":"+sprintf("%02d",date.getUTCMinutes())+":"+sprintf("%02d",date.getUTCSeconds())+"Z"},long_date:function(first,last,display_time,display_day){if(!first)return"";"string"==typeof first&&(first=new Date(first)),"string"==typeof last&&last&&(last=new Date(last)),last&&"object"==typeof last||(last=!1),display_time||(display_time=!1),display_day||(display_day=!1);var range="",datefmt=egw.preference("dateformat"),timefmt="12"===egw.preference("timeformat")?"h:i a":"H:i",month_before_day="m"==datefmt[0].toLowerCase()||"m"==datefmt[2].toLowerCase()&&"d"==datefmt[4];display_day&&(range=jQuery.datepicker.formatDate("DD",first)+("d"!=datefmt[0]?" ":", "));for(var i=0;5>i;i+=2)switch(datefmt[i]){case"d":if(range+=first.getUTCDate()+("."==datefmt[1]?".":""),!last||first.getUTCMonth()==last.getUTCMonth()&&first.getFullYear()==last.getFullYear())display_time&&(range+=" "+jQuery.datepicker.formatDate(dateTimeFormat(timefmt),last)),last&&(range+=" - ");else{if(month_before_day||(range+=jQuery.datepicker.formatDate("MM",first)),first.getFullYear()!=last.getFullYear()&&"Y"!=datefmt[0]&&(range+=("d"!=datefmt[0]?", ":" ")+first.getFullYear()),display_time&&(range+=" "+jQuery.datepicker.formatDate(dateTimeFormat(timefmt),first)),!last)return range;range+=" - ",first.getFullYear()!=last.getFullYear()&&"Y"==datefmt[0]&&(range+=last.getFullYear()+", "),month_before_day&&(range+=jQuery.datepicker.formatDate("MM",last))}last&&(range+=" "+last.getUTCDate()+("."==datefmt[1]?".":""));break;case"m":case"M":range+=" "+jQuery.datepicker.formatDate("MM",month_before_day?first:last)+" ";break;case"Y":"m"!=datefmt[0]&&(range+=" "+("Y"==datefmt[0]?first.getFullYear()+("d"==datefmt[2]?", ":" "):last.getFullYear()+" "))}return display_time&&last&&(range+=" "+jQuery.datepicker.formatDate(dateTimeFormat(timefmt),last)),"Y"==datefmt[4]&&"m"==datefmt[0]&&(range+=", "+last.getFullYear()),range},week_number:function(_date){var d=new Date(_date),day=d.getUTCDay();return"Monday"==egw.preference("weekdaystarts","calendar")||day?"Saturday"==egw.preference("weekdaystarts","calendar")&&6==day&&d.setUTCDate(d.getUTCDate()+2):d.setUTCDate(d.getUTCDate()+1),jQuery.datepicker.iso8601Week(new Date(d.valueOf()+60*d.getTimezoneOffset()*1e3))},start_of_week:function(date){var d=new Date(date),day=d.getUTCDay(),diff=0;switch(egw.preference("weekdaystarts","calendar")){case"Saturday":diff=6===day?0:0===day?-1:-(day+1);break;case"Monday":diff=0===day?-6:1-day;break;case"Sunday":default:diff=-day}return d.setUTCDate(d.getUTCDate()+diff),d},end_of_week:function(date){var d=app.calendar.date.start_of_week(date);return d.setUTCDate(d.getUTCDate()+6),d}},_setup_sidebox_filters:function(){var date_widget=this.sidebox_et2.getWidgetById("date");if(date_widget){date_widget.input_date.datepicker("option",{showButtonPanel:!1,onChangeMonthYear:function(year,month,inst){var go_button=date_widget.getRoot().getWidgetById("header_go");if(go_button){var temp_date=new Date(year,month-1,1,0,0,0);go_button.btn.attr("title",egw.lang(date("F",temp_date))),temp_date.setUTCMinutes(temp_date.getUTCMinutes()-temp_date.getTimezoneOffset()),go_button.btn.attr("data-date",temp_date.toJSON())}},beforeShowDay:function(date){var holidays=et2_calendar_view.get_holidays({day_class_holiday:function(){}},date.getFullYear()),day_holidays=holidays[""+date.getFullYear()+sprintf("%02d",date.getMonth()+1)+sprintf("%02d",date.getDate())],css_class="",tooltip="";if("undefined"!=typeof day_holidays&&day_holidays.length)for(var i=0;i<day_holidays.length;i++)css_class+="undefined"!=typeof day_holidays[i].birthyear?"calendar_calBirthday ":"calendar_calHoliday ",tooltip+=day_holidays[i].name+"\n";return[!0,css_class,tooltip]}});date_widget.input_date.on("mouseenter",".ui-datepicker-week-col",function(){$j(this).siblings().find("a").addClass("ui-state-hover")}).on("mouseleave",".ui-datepicker-week-col",function(){$j(this).siblings().find("a").removeClass("ui-state-hover")}).on("click",".ui-
//# sourceMappingURL=app.min.js.map