/** * Kendo UI v2018.1.117 (http://www.telerik.com/kendo-ui) * Copyright 2018 Telerik AD. All rights reserved. * * Kendo UI commercial licenses may be obtained at * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete * If you do not own a commercial license, this file shall be governed by the trial license terms. */ !function(e,define){define("kendo.scheduler.dayview.min",["kendo.scheduler.view.min"],e)}(function(){return function(e,t){function a(e){var t=new Date(1980,1,1,0,0,0);return h(t,T(e)),t}function i(e,t,a){return e>=t&&e<=a}function s(e,t,a,i){return i=i?e<=a:et&&i}function n(e,t,a,i){var s,n=e._continuousEvents,o=n[n.length-1],l=_(t.start.startDate()).getTime();if(i&&o&&_(o.start.startDate()).getTime()==l){for(s=n.length-1;s>-1&&!(n[s].isAllDay||_(n[s].start.startDate()).getTime()6?a-=7:a++,t.push(a);return t}var r=window.kendo,l=r.ui,d=r.support.browser,h=r.date.setTime,u=l.SchedulerView,c=r._outerWidth,p=r._outerHeight,f=e.extend,m=e.proxy,_=r.date.getDate,g=r.date.MS_PER_MINUTE,v=r.date.MS_PER_DAY,y="k-current-time",D="k-current-time-arrow",k=.8666,T=r.date.getMilliseconds,w=".kendoMultiDayView",S=r.template('
#:kendo.format("{0:t} - {1:t}", start, end)#
${title}
'),C=r.template('
${title}
'),x=r.template("#=kendo.toString(date, 'ddd M/dd')#"),H='
# if(data.tail || data.middle) {##}## if(data.isException()) {## } else if(data.isRecurring()) {## } #{0}#if (showDelete) {##}## if(data.head || data.middle) {##}##if(resizable && !singleDay && !data.tail && !data.middle){##}##if(resizable && !singleDay && !data.head && !data.middle){##}#
',E='
# if(data.isException()) {## } else if(data.isRecurring()) {## } #{0}#if (showDelete) {##}## if(data.tail || data.middle) {## } ## if(data.head || data.middle) {## } ## if(resizable && !data.tail && !data.middle) {## } ## if(resizable && !data.head && !data.middle) {## } #
',b=u.extend({init:function(e,t){var a=this;u.fn.init.call(a,e,t),a.title=a.options.title||a.options.name,a._workDays=o(a.options),a._templates(),a._editable(),a.calculateDateRange(),a._groups(),a._currentTime(!0)},_currentTimeMarkerUpdater:function(){this._updateCurrentTimeMarker(new Date)},_updateCurrentTimeMarker:function(t){var a,i,s,n,o,l,h,u,f,m,_,g,v,T,w,S,C=this.options;for(C.currentTimeMarker.useLocalTimezone===!1&&(a=C.dataSource.options.schema.timezone,C.dataSource&&a&&(i=r.timezone.offset(t,a),t=r.timezone.convert(t,t.getTimezoneOffset(),i))),this.times.find("."+y).remove(),this.content.find("."+y).remove(),s=C.group&&"horizontal"!=C.group.orientation?this.groups.length:1,n=this.times.find("tr:first th:first"),o=this.times.find("tr:first th:last"),l=0;l",v=e(g).prependTo(this.times),T=Math.round(f[0].innerRect(t,new Date(t.getTime()+1),!1).top),w={},S=this.content[0].scrollWidth,(d.msie||d.edge)&&(S-=1),this._isRtl?(w.right=n.position().left+p(n)-p(o),v.addClass(D+"-left")):(w.left=o.position().left,v.addClass(D+"-right")),w.top=T-c(v)*k/2,v.css(w),e(g).prependTo(this.content).css({top:T,height:"1px",right:0,width:S,left:0}))}},_currentTime:function(e){var a=this,i=a.options.currentTimeMarker;i!==!1&&i.updateInterval!==t&&(a._currentTimeMarkerUpdater(),e&&(a._currentTimeUpdateTimer=setInterval(m(this._currentTimeMarkerUpdater,a),i.updateInterval)))},_updateResizeHint:function(e,t,a,i){var s,n,o,l,d,h,c,p,f,m,_,g,v=e.isMultiDay(),y=this.groups[t],D=y.ranges(a,i,v,e.isAllDay);for(this._removeResizeHint(),d=0;d div"),g.length||(g=this.content)),this._resizeHint.appendTo(g),this._resizeHint.find(".k-label-top,.k-label-bottom").text(""),this._resizeHint.first().addClass("k-first").find(".k-label-top").text(r.toString(r.timezone.toLocalDate(a),_)),this._resizeHint.last().addClass("k-last").find(".k-label-bottom").text(r.toString(r.timezone.toLocalDate(i),_))},_updateMoveHint:function(t,a,i){var s,n,o,l,d,h,u,c,p,f,m=t.isMultiDay(),_=this.groups[a],g=r.date.toUtcTime(t.start)+i,v=g+t.duration(),y=_.ranges(g,v,m,t.isAllDay);for(g=r.timezone.toLocalDate(g),v=r.timezone.toLocalDate(v),this._removeMoveHint(t.uid),!m&&(0===T(v)||T(v)1&&y.pop(),s=e(),n=0;n div"),f.length||(f=this.content)),s.appendTo(f)},_appendMoveHint:function(e,t){e.addClass("k-event-drag-hint"),e.css(t),this._moveHint=this._moveHint.add(e)},_slotByPosition:function(e,t){var a,i,s,n;for(this._isVerticallyGrouped()?(i=this.content.offset(),t+=this.content[0].scrollTop,e+=this.content[0].scrollLeft):i=this.element.find(".k-scheduler-header-wrap:has(.k-scheduler-header-all-day)").find(">div").offset(),i&&(e-=i.left,t-=i.top),e=Math.ceil(e),t=Math.ceil(t),n=0;n',a=s.footer.command,a&&"workDay"===a?(t+='"):t+=" ",t+="",this.footer=e(t).appendTo(this.element),i=this,this.footer.on("click"+w,".k-scheduler-fullday",function(e){e.preventDefault(),i.trigger("navigate",{view:i.name||s.name,date:s.date,isWorkDay:!s.showWorkHours})}))},_forTimeRange:function(e,t,i,s){var n,o,r,l,d,u,c,p,f,m,_,y,D,k,w,S;for(e=a(e),t=a(t),n=this,o=T(e),r=T(t),l=n.options.minorTickCount,d=n.options.majorTick*g,u=d/l||1,c=new Date((+e)),p=c.getDate(),m=0,y="",_=v/u,o!=r&&(o>r&&(r+=v),_=(r-o)/u),_=Math.round(_);m<_;m++)D=m%(d/u),k=0===D,w=Dr&&(c=new Date((+t)))),s&&(y+=s(c)),y},_content:function(e){var t,a,i,s=this,n=s.options,o=s.startTime(),r=this.endTime(),l=1,d=1,h=e.length,u="",c=this.groupedResources,p=this.allDaySlotTemplate,f=!1,m=s._isGroupedByDate(),_=0;for(c.length&&(f="vertical"===s._groupOrientation(),f?(d=this._rowCountForLevel(this.rowLevels.length-2),m&&(l=this._columnCountForLevel(this.columnLevels.length-1)),n.allDaySlot&&(t=function(t){var a,i='',n=m?0:t,o=function(){return s._resourceBySlot({groupIndex:n})};if(m)for(;n"+p({date:e[_],resources:o})+"";else for(a=0;a"+p({date:e[a],resources:o})+"";return i+""})):l=m?this._columnCountForLevel(this.columnLevels.length-1)/this._columnCountForLevel(0):this._columnCountForLevel(this.columnLevels.length-2)),u+="",a=function(t,a,n){var o,r,d,u="",c=0;if(u="",m)for(o=0,r=h;o",this.content.find("table").append(u)},_addCellsToContent:function(e,t,a,i,s,n){var o,l=this,d="",h=this.slotTemplate,u="vertical"===this._groupOrientation(),c=function(e){return function(){return l._resourceBySlot({groupIndex:e})}};return r.date.isToday(t[i])&&(d+="k-today"),(r.date.getMilliseconds(a)=r.date.getMilliseconds(this.options.workDayEnd)||!this._isWorkDay(t[i]))&&(d+=" k-nonwork-hour"),e+="",o=r.date.getDate(t[i]),r.date.setTime(o,r.date.getMilliseconds(a)),e+=h({date:o,resources:c(u&&!l._isGroupedByDate()?n:s)}),e+=""},_isWorkDay:function(e){var t,a=e.getDay(),i=this._workDays;for(t=0;tm&&(this._headerColumnCount=i.length),s=a.start.offsetTop,n=0,o=i.length;n=x&&(x=T(new Date(this.endTime().getTime()+v-1))),a||t.isAllDay||(S=new Date(S.getTime()+v)),l=t.start,d=t.end,t.isAllDay&&(d=_(t.end)),!i(_(l),w,S)&&!i(d,w,S)||a&&Hx?o=!0:_(l)S&&!a||a&&E>x)&&(s=!0),h=this.eventResources(t),t._startTime&&H!==r.date.getMilliseconds(t.start)&&(l=new Date(H),l=r.timezone.apply(l,"Etc/UTC")),t._endTime&&E!==r.date.getMilliseconds(t.end)&&(d=new Date(E),d=r.timezone.apply(d,"Etc/UTC")),u=f({},{ns:r.ns,resizable:k,showDelete:D,middle:o,head:s,tail:n,singleDay:1==this._dates.length,resources:h,inverseColor:!(!h||!h[0])&&this._shouldInverseResourceColor(h[0]),messages:m.messages},t,{start:l,end:d}),c=e(p(u)),this.angular("compile",function(){return{elements:c,data:[{dataItem:u}]}}),c},_isInTimeSlot:function(e){var t,a=this.startTime(),i=this.endTime(),n=e._startTime||e.start,o=e._endTime||e.end;return T(i)===T(r.date.getDate(i))&&(i=r.date.getDate(i),h(i,v-1)),e._date("end")>e._date("start")&&(o=+e._date("end")+(v-1)),o=e._endTime?o-e._date("end"):T(new Date(o)),n=e._startTime?n-e._date("start"):T(new Date(n)),i=T(i),a=T(a),a===n&&n===o||(t=n!==i,s(n,a,i,t)||s(o,a,i,t)||s(a,n,o)||s(i,n,o))},_isInDateSlot:function(e){var t=this.groups[0],a=t.firstSlot().start,s=t.lastSlot().end-1,n=r.date.toUtcTime(e.start),o=r.date.toUtcTime(e.end);return(i(n,a,s)||i(o,a,s)||i(a,n,o)||i(s,n,o))&&(!i(o,a,a)||i(o,n,n)||e.isAllDay)},_updateAllDayHeaderHeight:function(e){var t,a;if(this._height!==e&&(this._height=e,t=this.element.find(".k-scheduler-header-all-day td"),t.length))for(t.parent().add(this.element.find(".k-scheduler-times-all-day").parent()).height(e),a=0;a div"),x=this._isGroupedByDate();for(i=0,s=e.length;i=v,r=o&&!this._isVerticallyGrouped()?C:this.content,o){if(this.options.allDaySlot&&(p=this.groups[t],p._continuousEvents||(p._continuousEvents=[]),d=p.slotRanges(a),d.length))if(h=d[0],y=h.start.index,D=h.end.index,x&&y!==D)for(u=h.start.start,c=h.end.end,k=new Date(u),T=new Date(u),w=h.start.index;w<=h.end.index;w++)l=this._createEventElement(a,!o,w!==D,w!==y),S=p.daySlotRanges(k,T,!0)[0],T.setDate(T.getDate()+1),k.setDate(k.getDate()+1),this._positionAllDayEvent(l,S),n(p,S,l,!0),l.appendTo(r);else l=this._createEventElement(a,!o),this._positionAllDayEvent(l,d[0]),n(p,d[0],l,!0),l.appendTo(r)}else if(this._isInTimeSlot(a))for(p=this.groups[t],p._continuousEvents||(p._continuousEvents=[]),d=p.slotRanges(a),f=d.length,m=0;m1&&(0===m?c=h.end.endDate():m==f-1?u=h.start.startDate():(u=h.start.startDate(),c=h.end.endDate())),_=a.clone({start:u,end:c,_startTime:a._startTime,_endTime:a.endTime}),this._isInTimeSlot(_)&&(g=h.head,l=this._createEventElement(a,!o,g,h.tail),l.appendTo(r),this._positionEvent(_,l,h),n(p,h,l,!1))},render:function(t){var a,s,n,o;for(this._headerColumnCount=0,this._groups(),this.element.find(".k-event").remove(),t=new r.data.Query(t).sort([{field:"start",dir:"asc"},{field:"end",dir:"desc"}]).toArray(),a=[],this._eventsByResource(t,this.groupedResources,a),s=e.map(this._dates,function(t){return Math.max.apply(null,e.map(a,function(a){return e.grep(a,function(e){return e.isMultiDay()&&i(t,_(e.start),_(e.end))}).length}))}),n=Math.max.apply(null,s),this._updateAllDayHeaderHeight((n+1)*this._allDayHeaderHeight),o=0;o1?this._eventsByResource(o,t.slice(1),a):a.push(o);else a.push(e)},_columnOffsetForResource:function(e){return this._columnCountForLevel(e)/this._columnCountForLevel(e-1)},_columnCountForLevel:function(e){var t=this.columnLevels[e];return t?t.length:0},_rowCountForLevel:function(e){var t=this.rowLevels[e];return t?t.length:0},clearSelection:function(){this.content.add(this.datesHeader).find(".k-state-selected").removeAttr("id").attr("aria-selected",!1).removeClass("k-state-selected")},_updateDirection:function(e,t,a,i,s){var n=e.isAllDay,o=t[0].start,r=t[t.length-1].end;a&&(s?n||o.index!==r.index||o.collectionIndex!==r.collectionIndex||(e.backward=i):(n&&o.index===r.index||!n&&o.collectionIndex===r.collectionIndex)&&(e.backward=i))},_changeViewPeriod:function(e,t,a){var i,s,n,o,r,l,d,u,c,p,f,m,_;if(!a)return i=t?this.previousDate():this.nextDate(),s=e.start,n=e.end,o=this._isGroupedByDate()&&this._isVerticallyGrouped(),r=this.groups[e.groupIndex],l=t?r._timeSlotCollections:r._getCollections(r.daySlotCollectionCount()),d=l[l.length-1]._slots,u=t||r.daySlotCollectionCount()?d.length-1:0,p=new Date(i),f=new Date(i),!this._isInRange(p,f)&&(e.start=p,e.end=f,o?(m=new Date(d[u].startDate()),_=new Date(d[u].endDate()),c=T(_)?T(_):v,h(e.start,T(m)),h(e.end,c),r.daySlotCollectionCount()&&(e.isAllDay=!e.isAllDay)):(c=e.isAllDay||!T(n)?v:T(n),h(e.start,T(s)),h(e.end,c)),this._isVerticallyGrouped()||(e.groupIndex=t?this.groups.length-1:0),e.events=[],!0)}});f(!0,l,{MultiDayView:b,DayView:b.extend({options:{name:"DayView",title:"Day"},name:"day"}),WeekView:b.extend({options:{name:"WeekView",title:"Week",selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}"},name:"week",calculateDateRange:function(){var e,t,a=this.options.date,i=r.date.dayOfWeek(a,this.calendarInfo().firstDay,-1),s=[];for(e=0,t=7;e