/** * Kendo UI v2016.1.112 (http://www.telerik.com/kendo-ui) * Copyright 2016 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(t,define){define("kendo.scheduler.timelineview.min",["kendo.scheduler.view.min"],t)}(function(){return function(t,e){function n(t){var e=new Date(1980,1,1,0,0,0);return d(e,p(t)),e}function i(t){var e=[],n=t.workWeekStart;for(e.push(n);t.workWeekEnd!=n;)n>6?n-=7:n++,e.push(n);return e}function o(t){var e,n=0;if(t.columns){for(e=0;t.columns.length>e;e++)n+=o(t.columns[e]);return t.colspan=n,n}return t.colspan=1,1}function s(t,e,n){var i,o,s,a;for(i=t.length-1;i>=0;i--)o=t[i].rectLeft,a=t[i].rectRight,s=e>=o&&a>=e,(s||o>=e&&n>=a||o>=e&&n>=o)&&(e>o&&(e=o),a>n&&(n=a));return r(t,e,n)}function r(t,e,n){var i,o,s=[];for(i=0;t.length>i;i++)o={rectLeft:t[i].rectLeft,rectRight:t[i].rectRight},(e>o.rectLeft&&o.rectRight>e||o.rectLeft>=e&&n>=o.rectRight)&&s.push(t[i]);return s}var a=window.kendo,l=a.ui,d=a.date.setTime,u=l.SchedulerView,c=t.extend,h=t.proxy,f=a.date.getDate,p=a.date.getMilliseconds,m=a.date.MS_PER_DAY,g=a.date.MS_PER_MINUTE,v=".kendoTimelineView",_=a.template('
#:kendo.format("{0:t} - {1:t}", start, end)#
${title}
'),k=a.template("#=kendo.format('{0:m}', date)#"),T='
# if(data.tail) {##}## if(data.isException()) {## } else if(data.isRecurring()) {## } #{0}#if (showDelete) {##}## if(data.head) {##}##if(resizable && !data.tail){##}##if(resizable && !data.head){##}#
',D=u.extend({init:function(t,e){var n=this;u.fn.init.call(n,t,e),n.title=n.options.title||n.options.name,n._workDays=i(n.options),n._templates(),n._editable(),n.calculateDateRange(),n._groups(),n._currentTime()},name:"timeline",_currentTimeMarkerUpdater:function(){var e,n,i,o,s,r,l,d,u,c,h,f,p=new Date,m=this.options;if(this.datesHeader.find(".k-current-time").remove(),this._isInDateSlot({start:p,end:p}))for(m.currentTimeMarker.useLocalTimezone===!1&&(e=m.dataSource.options.schema.timezone,m.dataSource&&e&&(n=a.timezone.offset(p,e),p=a.timezone.convert(p,p.getTimezoneOffset(),n))),i=m.group&&"vertical"!=m.group.orientation?this.groups.length:1,o=0;i>o;o++){if(s=this.groups[o],r=a.date.toUtcTime(p),l=s.timeSlotRanges(r,r+1),0===l.length)return;d=l[0].collection,u=d.slotByStartDate(p),u&&(c=t("
"),h=this.datesHeader,f=Math.round(l[0].innerRect(p,new Date(p.getTime()+1),!1).left),c.appendTo(h.find(".k-scheduler-header-wrap")).css({left:this._adjustLeftPosition(f),width:"1px",bottom:"1px",top:0}))}},_adjustLeftPosition:function(t){return this._isRtl&&(t-=this.content[0].scrollWidth-this.content[0].offsetWidth),t},_currentTime:function(){var t,n=this,i=n.options.currentTimeMarker;i!==!1&&i.updateInterval!==e&&(t=i.updateInterval,n._currentTimeMarkerUpdater(),n._currentTimeUpdateTimer=setInterval(h(this._currentTimeMarkerUpdater,n),t))},_editable:function(){this.options.editable&&(this._isMobile()?this._touchEditable():this._mouseEditable())},_mouseEditable:function(){var e=this;e.element.on("click"+v,".k-event a:has(.k-si-close)",function(n){e.trigger("remove",{uid:t(this).closest(".k-event").attr(a.attr("uid"))}),n.preventDefault()}),e.options.editable.create!==!1&&e.element.on("dblclick"+v,".k-scheduler-content td",function(t){var n,i=e._slotByPosition(t.pageX,t.pageY);i&&(n=e._resourceBySlot(i),e.trigger("add",{eventInfo:c({start:i.startDate(),end:i.endDate()},n)})),t.preventDefault()}),e.options.editable.update!==!1&&e.element.on("dblclick"+v,".k-event",function(n){e.trigger("edit",{uid:t(this).closest(".k-event").attr(a.attr("uid"))}),n.preventDefault()})},_touchEditable:function(){var e=this,n=0;a.support.mobileOS.android&&(n=5),e.options.editable.create!==!1&&(e._addUserEvents=new a.UserEvents(e.element,{threshold:n,filter:".k-scheduler-content td",tap:function(t){var n,i=e._slotByPosition(t.x.location,t.y.location);i&&(n=e._resourceBySlot(i),e.trigger("add",{eventInfo:c({start:i.startDate(),end:i.endDate()},n)})),t.preventDefault()}})),e.options.editable.update!==!1&&(e._editUserEvents=new a.UserEvents(e.element,{threshold:n,filter:".k-event",tap:function(n){var i=t(n.target).closest(".k-event");i.hasClass("k-event-active")||e.trigger("edit",{uid:i.attr(a.attr("uid"))}),n.preventDefault()}}))},_slotByPosition:function(t,e){var n,i,o,s,r=this.content,l=r.offset();for(t-=l.left,e-=l.top,this._isRtl?(s=a.support.browser,s.mozilla?(t+=r[0].scrollWidth-r[0].offsetWidth,t+=r[0].scrollLeft):s.msie?(t-=r.scrollLeft(),t+=r[0].scrollWidth-r[0].offsetWidth):s.webkit&&(t+=r[0].scrollLeft)):t+=r[0].scrollLeft,e+=r[0].scrollTop,t=Math.ceil(t),e=Math.ceil(e),o=0;this.groups.length>o;o++)if(i=this.groups[o],n=i.timeSlotByPosition(t,e))return n;return null},options:{name:"TimelineView",title:"Timeline",selectedDateFormat:"{0:D}",selectedShortDateFormat:"{0:d}",date:a.date.today(),startTime:a.date.today(),endTime:a.date.today(),showWorkHours:!1,minorTickCount:2,editable:!0,workDayStart:new Date(1980,1,1,8,0,0),workDayEnd:new Date(1980,1,1,17,0,0),workWeekStart:1,workWeekEnd:5,majorTick:60,eventHeight:25,eventMinWidth:0,columnWidth:100,groupHeaderTemplate:"#=text#",majorTimeHeaderTemplate:"#=kendo.toString(date, 't')#",slotTemplate:" ",eventTemplate:_,dateHeaderTemplate:k,footer:{command:"workDay"},currentTimeMarker:{updateInterval:1e4,useLocalTimezone:!0},messages:{defaultRowText:"All events",showFullDay:"Show full day",showWorkDay:"Show business hours"}},events:["remove","add","edit"],_templates:function(){var t=this.options,e=c({},a.Template,t.templateSettings);this.eventTemplate=this._eventTmpl(t.eventTemplate,T),this.majorTimeHeaderTemplate=a.template(t.majorTimeHeaderTemplate,e),this.dateHeaderTemplate=a.template(t.dateHeaderTemplate,e),this.slotTemplate=a.template(t.slotTemplate,e),this.groupHeaderTemplate=a.template(t.groupHeaderTemplate,e)},_render:function(e){var n=this;e=e||[],n._dates=e,n._startDate=e[0],n._endDate=e[e.length-1||0],n._calculateSlotRanges(),n.createLayout(n._layout(e)),n._content(e),n._footer(),n._setContentWidth(),n.refreshLayout(),n.datesHeader.on("click"+v,".k-nav-day",function(e){var i=t(e.currentTarget).closest("th"),o=n._slotByPosition(i.offset().left,n.content.offset().top);n.trigger("navigate",{view:"timeline",date:o.startDate()})}),n.timesHeader.find("table tr:last").hide(),n.datesHeader.find("table tr:last").hide()},_setContentWidth:function(){var t=this.content,e=t.width(),n=this.content.find("table"),i=n.find("tr:first").children().length,o=100,s=i*this.options.columnWidth;s>e&&(o=Math.ceil(s/e*100)),n.add(this.datesHeader.find("table")).css("width",o+"%")},_calculateSlotRanges:function(){var t,e,n,i,o=this._dates,s=this.startTime(),r=this.endTime();for(p(r)===p(a.date.getDate(r))&&(r=a.date.getDate(r),d(r,m-1)),r=p(r),s=p(s),t=[],e=0;o.length>e;e++)n=f(o[e]),d(n,s),i=f(o[e]),d(i,r),t.push({start:a.date.toUtcTime(n),end:a.date.toUtcTime(i)});this._slotRanges=t},_forTimeRange:function(t,e,i,o){var s,r,a,l,u,c,h,f,v,_,k,T,D,w,y,S,R,x;for(t=n(t),e=n(e),s=this,r=p(t),a=p(e),l=s.options.minorTickCount,u=s.options.majorTick*g,c=u/l||1,h=new Date(+t),f=h.getDate(),_=0,T="",k=m/c,r!=a&&(r>a&&(a+=m),k=(a-r)/c),k=Math.round(k);k>_;_++)D=_%(u/c),w=0===D,y=l-1>D,S=D===l-1,R=l,k%l!==0&&(x=l>k-(_+1),w&&x&&(R=k%l)),T+=i(h,w,y,S,R),d(h,c,!1);return a&&(v=p(h),fa&&(h=new Date(+e))),o&&(T+=o(h)),T},_layout:function(t){var e,n,i,s=[],r=[],a=this,l=[{text:a.options.messages.defaultRowText}],d=[];for(e=0;a.options.minorTickCount>e;e++)d.push({text:"",className:""});for(this._forTimeRange(a.startTime(),a.endTime(),function(t,e,n,i,r){var l,u=a.majorTimeHeaderTemplate;e&&(l={text:u({date:t}),className:i?"k-slot-cell":"",columns:d.slice(0,r)},o(l),s.push(l))}),n=0;t.length>n;n++)r.push({text:a.dateHeaderTemplate({date:t[n]}),className:"k-slot-cell",columns:s.slice(0)});return i=this.groupedResources,i.length&&("vertical"===this._groupOrientation()?l=a._createRowsLayout(i,null,this.groupHeaderTemplate):r=a._createColumnsLayout(i,r,this.groupHeaderTemplate)),{columns:r,rows:l}},_footer:function(){var e,n,i,o=this.options;o.footer!==!1&&(e='",this.footer=t(e).appendTo(this.element),i=this,this.footer.on("click"+v,".k-scheduler-fullday",function(t){t.preventDefault(),i.trigger("navigate",{view:i.name||o.name,date:i.startDate(),isWorkDay:!o.showWorkHours})}))},_columnCountForLevel:function(t){var e=this.columnLevels[t];return e?e.length:0},_rowCountForLevel:function(t){var e=this.rowLevels[t];return e?e.length:0},_isWorkDay:function(t){var e,n=t.getDay(),i=this._workDays;for(e=0;i.length>e;e++)if(i[e]===n)return!0;return!1},_content:function(t){var e,n,i,o,s,r=this,l=r.options,d=r.startTime(),u=this.endTime(),c=1,h=1,f=t.length,p="",m=this.groupedResources,g=this.slotTemplate,v=!1;for(m.length&&(v="vertical"===r._groupOrientation(),v?h=r._groupCount():c=r._groupCount()),p+="",e=function(e){var s,d="",u="",c=function(t){return function(){return r._resourceBySlot({groupIndex:t})}};return a.date.isToday(t[o])&&(u+="k-today"),(a.date.getMilliseconds(e)=a.date.getMilliseconds(l.workDayEnd)||!r._isWorkDay(t[o]))&&(u+=" k-nonwork-hour"),d+="",s=a.date.getDate(t[o]),a.date.setTime(s,a.date.getMilliseconds(e)),d+=g({date:s,resources:c(v?n:i)}),d+=""},n=0;h>n;n++){for(p+="",i=0;c>i;i++)for(o=0,s=f;s>o;o++)p+=this._forTimeRange(d,u,e);p+=""}p+="",this.content.find("table").append(p)},_groups:function(){var t,e,n,i,o=this._groupCount(),s=this._dates,r=s.length;for(this.groups=[],t=0;o>t;t++)e=this._addResourceView(t),n=s[0],i=s[s.length-1||0],e.addTimeSlotCollection(n,a.date.addDays(i,1));this._timeSlotGroups(o,r)},_isVerticallyGrouped:function(){return this.groupedResources.length&&"vertical"===this._groupOrientation()},_isHorizontallyGrouped:function(){return this.groupedResources.length&&"horizontal"===this._groupOrientation()},_timeSlotGroups:function(t,e){var n,i,o,s,r,a,l,d,u,c,h,f,m,g,v,_,k,T,D=this._timeSlotInterval(),w=this._isVerticallyGrouped(),y=this.content.find("tr"),S=y.length;for(y.attr("role","row"),w&&(S=Math.floor(S/t)),n=0;t>n;n++)for(i=0,o=this.groups[n],w&&(i=n),r=i*S,a=0,w||(a=n),l=y[r].children,d=l.length/(w?1:t),u=d/e,c=0;e>c;c++)for(h=c*u+d*a,s=p(new Date(+this.startTime())),f=0;u>f;f++)m=l[f+h],g=o.getTimeSlotCollection(0),v=this._dates[c],_=Date.UTC(v.getFullYear(),v.getMonth(),v.getDate()),k=_+s,T=k+D,m.setAttribute("role","gridcell"),m.setAttribute("aria-selected",!1),g.addTimeSlot(m,k,T,!0),s+=D},startDate:function(){return this._startDate},endDate:function(){return this._endDate},startTime:function(){var t=this.options;return t.showWorkHours?t.workDayStart:t.startTime},endTime:function(){var t=this.options;return t.showWorkHours?t.workDayEnd:t.endTime},_timeSlotInterval:function(){var t=this.options;return t.majorTick/t.minorTickCount*g},nextDate:function(){return a.date.nextDay(this.endDate())},previousDate:function(){return a.date.previousDay(this.startDate())},calculateDateRange:function(){this._render([this.options.date])},render:function(t){var e,n,i,o,s;for(this._headerColumnCount=0,this._groups(),this.element.find(".k-event").remove(),t=new a.data.Query(t).sort([{field:"start",dir:"asc"},{field:"end",dir:"desc"}]).toArray(),e=[],this._eventsByResource(t,this.groupedResources,e),n=[],i=0,o=0;e.length>o;o++)s={groupIndex:o,maxRowCount:0,events:{}},n.push(s),this._renderEvents(e[o],o,s),s.maxRowCount>i&&(i=s.maxRowCount);this._setRowsHeight(n,e.length,i),this._positionEvents(n,e.length),this.trigger("activate")},_positionEvents:function(t,e){var n,i,o,s;for(n=0;e>n;n++){i=t[n].events;for(o in i)s=i[o],this._positionEvent(s)}},_setRowsHeight:function(e,n,i){var o,s,r,a,l,d=this.options.eventHeight+2,u=this._getBottomRowOffset();for(n=this._isVerticallyGrouped()?n:1,o=0;n>o;o++)s=this._isVerticallyGrouped()?e[o].maxRowCount:i,s=s?s:1,r=(d+2)*s+u,a=t(this.times.find("tr")[o]),l=t(this.content.find("tr")[o]),a.height(r),l.height(r);this._setContentWidth(),this.refreshLayout(),this._refreshSlots()},_getBottomRowOffset:function(){var t,e,n=.5*this.options.eventHeight,i=this._isMobile();return i?(t=30,e=60):(t=15,e=30),n>e?n=e:t>n&&(n=t),n},_positionEvent:function(t){var e,n,i,o=this.options.eventHeight+2,s=t.slotRange.innerRect(t.start,t.end,!1),r=this._adjustLeftPosition(s.left),a=s.right-s.left-2;0>a&&(a=0),this.options.eventMinWidth>a&&(e=t.slotRange.collection,n=e._slots[e._slots.length-1],i=n.offsetLeft+n.offsetWidth,a=this.options.eventMinWidth,r+a>i&&(a=i-s.left-2)),t.element.css({top:t.slotRange.start.offsetTop+t.rowIndex*(o+2)+"px",left:r,width:a})},_refreshSlots:function(){for(var t=0;this.groups.length>t;t++)this.groups[t].refresh()},_eventsByResource:function(t,e,n){var i,o,s,r,l=e[0];if(l)for(i=l.dataSource.view(),o=0;i.length>o;o++)s=this._resourceValue(l,i[o]),r=new a.data.Query(t).filter({field:l.field,operator:u.groupEqFilter(s)}).toArray(),e.length>1?this._eventsByResource(r,e.slice(1),n):n.push(r);else n.push(t)},_isInDateSlot:function(t){var e=t.start,n=t.end,i=f(this._startDate),o=a.date.addDays(f(this._endDate),1);return o>e&&n>=i?!0:!1},_isInTimeSlot:function(t){var e,n=t._startTime||a.date.toUtcTime(t.start),i=t._endTime||a.date.toUtcTime(t.end),o=this._slotRanges;for(n===i&&(i+=1),e=0;o.length>e;e++)if(o[e].end>n&&i>o[e].start)return!0;return!1},_adjustEvent:function(t){var e,n=t.start,i=t.end,o=t._time("start"),s=t._time("end"),r=p(this.startTime()),l=p(this.endTime()),u=null,c=null,h=!1,g=!1;return t.isAllDay?(u=f(n),r>o&&(d(u,r),g=!0),c=f(i),l===p(f(this.endTime()))?c=a.date.addDays(c,1):(d(c,l),h=!0)):(l=0===l?m:l,r>o?(u=f(n),d(u,r),g=!0):o>l&&(u=f(n),u=a.date.addDays(u,1),d(u,r),g=!0),s>l?(c=f(i),d(c,l),h=!0):r>s&&(c=f(i),c=a.date.addDays(c,-1),d(c,l),h=!0)),e=t.clone({start:u?u:n,end:c?c:i,_startTime:u?a.date.toUtcTime(u):t._startTime,_endTime:c?a.date.toUtcTime(c):t._endTime,isAllDay:!1}),{occurrence:e,head:h,tail:g}},_renderEvents:function(t,e,n){var i,o,s,r,a,l,d,u,c,h,f;for(o=0,s=t.length;s>o;o++)i=t[o],this._isInDateSlot(i)&&(r=i.isAllDay||i.end.getTime()-i.start.getTime()>=m,a=this.content,(r||this._isInTimeSlot(i))&&(l=this._adjustEvent(i),d=this.groups[e],d._continuousEvents||(d._continuousEvents=[]),u=d.slotRanges(l.occurrence,!1),c=u[0],this._isInTimeSlot(l.occurrence)&&(h=this._createEventElement(l.occurrence,i,c.head||l.head,c.tail||l.tail),h.appendTo(a).css({top:0,height:this.options.eventHeight}),f={start:l.occurrence._startTime||l.occurrence.start,end:l.occurrence._endTime||l.occurrence.end,element:h,uid:i.uid,slotRange:c,rowIndex:0,offsetTop:0},n.events[i.uid]=f,this.addContinuousEvent(d,c,h,i.isAllDay),this._arrangeRows(f,c,n))))},addContinuousEvent:function(t,e,n,i){var o=t._continuousEvents;o.push({element:n,isAllDay:i,uid:n.attr(a.attr("uid")),start:e.start,end:e.end})},_createEventElement:function(e,n,i,o){var s,r,l=this.eventTemplate,d=this.options.editable,u=this._isMobile(),h=d&&d.destroy!==!1&&!u,f=d&&d.resize!==!1,p=n._time("start"),m=n._time("end"),g=n.start,v=n.end,_=this.eventResources(n);return n._startTime&&p!==a.date.getMilliseconds(n.start)&&(g=new Date(p),g=a.timezone.apply(g,"Etc/UTC")),n._endTime&&m!==a.date.getMilliseconds(n.end)&&(v=new Date(m),v=a.timezone.apply(v,"Etc/UTC")),s=c({},{ns:a.ns,resizable:f,showDelete:h,head:i,tail:o,singleDay:1==this._dates.length,resources:_,inverseColor:_&&_[0]?this._shouldInverseResourceColor(_[0]):!1},n,{start:g,end:v}),r=t(l(s)),this.angular("compile",function(){return{elements:r,data:[{dataItem:s}]}}),r},_arrangeRows:function(t,e,n){var i,o,r,a,l,d,c=e.start.index,h=e.end.index,f=t.slotRange.innerRect(t.start,t.end,!1),p=f.right+this.options.eventMinWidth,m=s(e.events(),f.left,p);for(e.addEvent({slotIndex:c,start:c,end:h,rectLeft:f.left,rectRight:p,element:t.element,uid:t.uid}),m.push({start:c,end:h,uid:t.uid}),i=u.createRows(m),i.length>n.maxRowCount&&(n.maxRowCount=i.length),o=0,r=i.length;r>o;o++)for(a=i[o].events,l=0,d=a.length;d>l;l++)n.events[a[l].uid].rowIndex=o},_groupCount:function(){var t=this.groupedResources;return t.length?"vertical"===this._groupOrientation()?this._rowCountForLevel(t.length-1):this._columnCountForLevel(t.length-1):1},_updateEventForSelection:function(t){var e=this._adjustEvent(t.clone());return e.occurrence},_eventOptionsForMove:function(t){return t.isAllDay?{isAllDay:!1}:{}},_updateEventForResize:function(t){t.isAllDay&&t.set("isAllDay",!1)},_updateMoveHint:function(t,e,n){var i,o,s,r,a,l,d,u,c,h,f,p=this.groups[e],m=t.clone({start:t.start,end:t.end}),g=m.duration();for(m.start=new Date(m.start.getTime()+n),m.end=new Date(+m.start+g),i=this._adjustEvent(m),o=p.slotRanges(i.occurrence,!1),this._removeMoveHint(),s=0;o.length>s;s++)r=o[s],a=r.start,l=this._createEventElement(i.occurrence,i.occurrence,!1,!1),l.addClass("k-event-drag-hint"),d=r.innerRect(i.occurrence.start,i.occurrence.end,this.options.snap),u=d.right-d.left-2,0>u&&(u=0),c=this._adjustLeftPosition(d.left),h={left:c,top:a.offsetTop,height:a.offsetHeight-2,width:u},l.css(h),this._moveHint=this._moveHint.add(l);f=this.content,this._moveHint.appendTo(f)},_updateResizeHint:function(t,e,n,i){var o,s,r,l,d,c,h,f,p,m,g=this.groups[e],v=g.ranges(n,i,!1,!1);for(this._removeResizeHint(),o=0;v.length>o;o++)s=v[o],r=s.startSlot(),l=s.innerRect(n,i,!1),l.top=r.offsetTop,d=l.right-l.left,c=r.offsetHeight,h=this._adjustLeftPosition(l.left),f=u.fn._createResizeHint.call(this,h,l.top,d,c),this._resizeHint=this._resizeHint.add(f);p="t",m=this.content,this._resizeHint.appendTo(m),this._resizeHint.find(".k-label-top,.k-label-bottom").text(""),this._resizeHint.first().addClass("k-first").find(".k-label-top").text(a.toString(a.timezone.toLocalDate(n),p)),this._resizeHint.last().addClass("k-last").find(".k-label-bottom").text(a.toString(a.timezone.toLocalDate(i),p))},selectionByElement:function(t){var e=t.offset();return this._slotByPosition(e.left,e.top)},_updateDirection:function(t,e,n,i,o){var s=e[0].start,r=e[e.length-1].end;n&&!o&&s.index===r.index&&s.collectionIndex===r.collectionIndex&&(t.backward=i)},_changeGroup:function(t,e){var n=e?"prevGroupSlot":"nextGroupSlot",i=this[n](t.start,t.groupIndex,!1);return i&&(t.groupIndex+=e?-1:1),i},prevGroupSlot:function(t,e,n){var i,o=this.groups[e],s=o.ranges(t,t,n,!1)[0].start;if(!(0>=e))return this._isVerticallyGrouped()?s:(i=o._collection(0,n),i.last())},nextGroupSlot:function(t,e,n){var i,o=this.groups[e],s=o.ranges(t,t,n,!1)[0].start;if(!(e>=this.groups.length-1))return this._isVerticallyGrouped()?s:(i=o._collection(0,n),i.first())},_verticalSlots:function(t,e,n,i){var o=i?"leftSlot":"rightSlot",s=e[0].start,r=e[e.length-1].end,a=this.groups[t.groupIndex];return s=a[o](s),r=a[o](r),n||!this._isVerticallyGrouped()||s&&r||(s=r=this._changeGroup(t,i)),{startSlot:s,endSlot:r}},_horizontalSlots:function(t,e,n,i){var o=i?"upSlot":"downSlot",s=e[0].start,r=e[e.length-1].end,a=this.groups[t.groupIndex];return s=a[o](s),r=a[o](r),n||!this._isHorizontallyGrouped()||s&&r||(s=r=this._changeGroup(t,i)),{startSlot:s,endSlot:r}},_changeViewPeriod:function(t,e){var n,i=e?this.previousDate():this.nextDate(),o=t.start,s=t.end;return t.start=new Date(i),t.end=new Date(i),this._isHorizontallyGrouped()&&(t.groupIndex=e?this.groups.length-1:0),n=s-o,e?(s=p(this.endTime()),s=0===s?m:s,d(t.start,s-n),d(t.end,s)):(o=p(this.startTime()),d(t.start,o),d(t.end,o+n)),t.events=[],!0},move:function(t,e,n){var i,o,s,r,l,d=!1,u=this.groups[t.groupIndex],c=a.keys,h=u.ranges(t.start,t.end,!1,!1);if(e===c.DOWN||e===c.UP)d=!0,s=e===c.UP,this._updateDirection(t,h,n,s,!0),r=this._verticalSlots(t,h,n,s);else if((e===c.LEFT||e===c.RIGHT)&&(d=!0,s=e===c.LEFT,this._updateDirection(t,h,n,s,!1),r=this._horizontalSlots(t,h,n,s),(!r.startSlot||!r.endSlot)&&!n&&this._changeViewPeriod(t,s,!1)))return d;return d&&(i=r.startSlot,o=r.endSlot,n?(l=t.backward,l&&i?t.start=i.startDate():!l&&o&&(t.end=o.endDate())):i&&o&&(t.start=i.startDate(),t.end=o.endDate()),t.events=[]),d},destroy:function(){var t=this;t.element&&t.element.off(v),t.footer&&t.footer.remove(),t._currentTimeUpdateTimer&&clearInterval(t._currentTimeUpdateTimer),u.fn.destroy.call(this),this._isMobile()&&t.options.editable&&(t.options.editable.create!==!1&&t._addUserEvents.destroy(),t.options.editable.update!==!1&&t._editUserEvents.destroy())}});c(!0,l,{TimelineView:D,TimelineWeekView:D.extend({options:{name:"TimelineWeekView",title:"Timeline Week",selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}",majorTick:120},name:"timelineWeek",calculateDateRange:function(){var t,e,n=this.options.date,i=a.date.dayOfWeek(n,this.calendarInfo().firstDay,-1),o=[];for(t=0,e=7;e>t;t++)o.push(i),i=a.date.nextDay(i);this._render(o)}}),TimelineWorkWeekView:D.extend({options:{name:"TimelineWorkWeekView",title:"Timeline Work Week",selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}",majorTick:120},name:"timelineWorkWeek",nextDate:function(){return a.date.dayOfWeek(a.date.nextDay(this.endDate()),this.options.workWeekStart,1)},previousDate:function(){return a.date.previousDay(this.startDate())},calculateDateRange:function(){for(var t=this.options.date,e=a.date.dayOfWeek(t,this.options.workWeekStart,-1),n=a.date.dayOfWeek(e,this.options.workWeekEnd,1),i=[];n>=e;)i.push(e),e=a.date.nextDay(e);this._render(i)}}),TimelineMonthView:D.extend({options:{name:"TimelineMonthView",title:"Timeline Month",selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}",workDayStart:new Date(1980,1,1,0,0,0),workDayEnd:new Date(1980,1,1,23,59,59),footer:!1,majorTick:1440,minorTickCount:1},name:"timelineMonth",calculateDateRange:function(){var t,e,n=this.options.date,i=a.date.firstDayOfMonth(n),o=a.date.lastDayOfMonth(n),s=[];for(t=0,e=o.getDate();e>t;t++)s.push(i),i=a.date.nextDay(i);this._render(s)}})})}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(t,e,n){(n||e)()}); //# sourceMappingURL=kendo.scheduler.timelineview.min.js.map