{"version":3,"sources":["kendo.scheduler.dayview.js"],"names":["f","define","$","undefined","toInvariantTime","date","staticDate","Date","setTime","getMilliseconds","isInDateRange","value","min","max","isInTimeRange","overlaps","addContinuousEvent","group","range","element","isAllDay","idx","events","_continuousEvents","lastEvent","length","startDate","getDate","start","getTime","splice","uid","attr","kendo","end","push","getWorkDays","options","workDays","dayIndex","workWeekStart","workWeekEnd","window","ui","SchedulerView","outerWidth","_outerWidth","outerHeight","_outerHeight","extend","proxy","MS_PER_MINUTE","MS_PER_DAY","CURRENT_TIME_MARKER_CLASS","CURRENT_TIME_MARKER_ARROW_CLASS","BORDER_SIZE_COEFF","NS","DAY_VIEW_EVENT_TEMPLATE","template","DAY_VIEW_ALL_DAY_EVENT_TEMPLATE","DATA_HEADER_TEMPLATE","ALLDAY_EVENT_WRAPPER_STRING","EVENT_WRAPPER_STRING","MultiDayView","init","that","this","fn","call","title","name","_workDays","_templates","_editable","calculateDateRange","_groups","_currentTime","_currentTimeMarkerUpdater","_updateCurrentTimeMarker","currentTime","timezone","timezoneOffset","groupsCount","firstTimesCell","lastTimesCell","groupIndex","currentGroup","utcCurrentTime","ranges","collection","slotElement","elementHtml","timesTableMarker","markerTopPosition","timesTableMarkerCss","currentTimeMarker","useLocalTimezone","dataSource","schema","offset","convert","getTimezoneOffset","times","find","remove","content","orientation","groups","toUtcTime","timeSlotRanges","slotByStartDate","prependTo","Math","round","innerRect","top","_isRtl","right","position","left","addClass","css","height","width","scrollWidth","setUpdateTimer","markerOptions","updateInterval","_currentTimeUpdateTimer","setInterval","_updateResizeHint","event","startTime","endTime","hint","rangeIndex","slotIdx","slot","rect","format","container","multiday","isMultiDay","_removeResizeHint","startSlot","_isGroupedByDate","index","_slots","offsetWidth","clientHeight","offsetTop","_createResizeHint","offsetLeft","_resizeHint","add","innerWidth","outerRect","snap","bottom","appendTo","text","first","toString","toLocalDate","last","_updateMoveHint","distance","duration","_removeMoveHint","pop","clientWidth","offsetHeight","_createEventElement","clone","_appendMoveHint","_moveHint","_slotByPosition","x","y","_isVerticallyGrouped","scrollTop","scrollLeft","ceil","daySlotByPosition","timeSlotByPosition","_groupCount","resources","groupedResources","byDate","_groupOrientation","_columnCountForLevel","_rowCountForLevel","_columnOffsetForResource","_columnCountInResourceView","_timeSlotGroups","groupCount","columnCount","time","rowIndex","cellIndex","rowCount","rowMultiplier","cellMultiplier","cells","timeIndex","interval","_timeSlotInterval","verticalViews","tableRows","floor","children","_addTimeSlotGroup","cell","getTimeSlotCollection","currentDate","_dates","UTC","getFullYear","getMonth","setAttribute","addTimeSlot","_addDaySlotGroup","cellCount","addDaySlot","_daySlotGroups","getDaySlotCollection","view","columnIndex","_addResourceView","addTimeSlotCollection","addDays","allDaySlot","addDaySlotCollection","selectedDateFormat","selectedShortDateFormat","showWorkHours","today","minorTickCount","majorTick","majorTimeHeaderTemplate","minorTimeHeaderTemplate","groupHeaderTemplate","slotTemplate","allDaySlotTemplate","eventTemplate","allDayEventTemplate","dateHeaderTemplate","editable","workDayStart","workDayEnd","footer","command","messages","allDay","showFullDay","showWorkDay","settings","Template","templateSettings","_eventTmpl","_isMobile","_touchEditable","_mouseEditable","on","e","trigger","closest","preventDefault","create","resourceInfo","parent","hasClass","pageX","pageY","_resourceBySlot","eventInfo","endDate","update","threshold","support","mobileOS","android","_addUserEvents","UserEvents","filter","tap","target","location","_allDayUserEvents","_editUserEvents","eventElement","_layout","dates","column","columns","rows","isToday","className","cellContent","_forTimeRange","middleRow","lastSlotRow","row","_createDateLayout","_createColumnsLayout","_createRowsLayout","_footer","html","isWorkDay","action","after","msMin","msMax","msMajorInterval","msInterval","startDay","msStart","majorTickDivider","isMajorTickRow","isMiddleRow","isLastSlotRow","_content","allDayVerticalGroupRow","appendRow","rowIdx","isVerticalGroupped","dateID","rowLevels","columnLevels","result","dateGroupIndex","dateIndex","groupIdx","_addCellsToContent","append","tmplDate","classes","_isWorkDay","i","day","getDay","_render","allDayHeader","_startDate","_endDate","createLayout","refreshLayout","_allDayHeaderHeight","th","currentTarget","additioanlWidth","additionalHeight","datesHeader","_end","nextDate","nextDay","previousDate","previousDay","destroy","clearInterval","off","inRange","selectionByElement","_timeSlotIndex","eventStartTime","timeSlotInterval","_slotIndex","_dateSlotIndex","slotStart","slotEnd","slots","_positionAllDayEvent","slotRange","rowEvents","j","eventLength","slotWidth","startIndex","endIndex","allDayEvents","collidingEvents","currentColumnCount","_headerColumnCount","leftOffset","rightOffset","eventHeight","addEvent","slotIndex","createRows","_arrangeColumns","eventRightOffset","columnEvents","eventElements","slotEvents","columnWidth","createColumns","style","_positionEvent","_startTime","_endTime","isOneDayEvent","head","tail","middle","eventStartDate","eventEndDate","data","isMobile","showDelete","resizable","resize","_time","eventEndTime","eventResources","apply","ns","singleDay","inverseColor","_shouldInverseResourceColor","angular","elements","dataItem","_isInTimeSlot","slotStartTime","slotEndTime","_date","_isInDateSlot","firstSlot","lastSlot","_updateAllDayHeaderHeight","allDaySlots","_height","refresh","_renderEvents","isMultiDayEvent","rangeCount","occurrence","newStart","newEnd","dateRange","allDayEventContainer","slotRanges","daySlotRanges","setDate","render","eventsByResource","eventsPerDate","Query","sort","field","dir","toArray","_eventsByResource","map","grep","itemIdx","eventsFilteredByResource","resource","_resourceValue","operator","groupEqFilter","slice","level","columnLevel","rowLevel","clearSelection","removeAttr","removeClass","_updateDirection","selection","multiple","reverse","vertical","isDaySlot","endSlot","collectionIndex","backward","_changeViewPeriod","verticalByDate","endMilliseconds","_timeSlotCollections","_getCollections","daySlotCollectionCount","DayView","WeekView","selectedDate","dayOfWeek","calendarInfo","firstDay","WorkWeekView","weekStart","jQuery","amd","a1","a2","a3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;CAwBC,SAAUA,EAAGC,QACVA,OAAO,2BAA4B,wBAAyBD,IAC9D,WAo7CE,MA36CC,UAAUE,EAAGC,GAGV,QAASC,GAAgBC,GACrB,GAAIC,GAAa,GAAIC,MAAK,KAAM,EAAG,EAAG,EAAG,EAAG,EAE5C,OADAC,GA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WACN4R,SAAU,WACN,GAAIwI,GAAYzc,EAAM5B,KAAKie,UAAUrc,EAAM5B,KAAK8V,QAAQjS,KAAKxC,aAAcwC,KAAKqa,eAAeC,SAAU,EACzG,OAAOvc,GAAM5B,KAAKiO,QAAQoQ,EAAWxa,KAAKK,UAAU,KAExD6R,aAAc,WAAA,GACNsI,GAAYzc,EAAM5B,KAAKie,UAAUpa,KAAKxC,YAAawC,KAAKqa,eAAeC,aACvElc,EAAW4B,KAAKK,SACpB,OAAOtC,GAAM5B,KAAKiO,QAAQoQ,EAAWpc,EAASA,EAASb,OAAS,GAAK,IAEzEiD,mBAAoB,WAEhB,IADA,GAAI2Z,GAAena,KAAK7B,QAAQhC,KAAMie,EAAYrc,EAAM5B,KAAKie,UAAWI,EAAYJ,EAAUD,EAAcna,KAAKqa,eAAeC,aAAe5c,EAAQ0c,EAAUI,EAAWxa,KAAK7B,QAAQG,cAAe,GAAIN,EAAMoc,EAAU1c,EAAOsC,KAAK7B,QAAQI,YAAa,GAAI2P,KAC1PxQ,GAASM,GACZkQ,EAAMjQ,KAAKP,GACXA,EAAQK,EAAM5B,KAAK8V,QAAQvU,EAE/BsC,MAAKmR,QAAQjD,SAI3B1P,OAAOT,MAAM0c,QACRjc,OAAOT,OACE,kBAAVhC,SAAwBA,OAAO2e,IAAM3e,OAAS,SAAU4e,EAAIC,EAAIC,IACrEA,GAAMD","file":"kendo.scheduler.dayview.min.js","sourcesContent":["/*!\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n*/\n(function (f, define) {\n define('kendo.scheduler.dayview', ['kendo.scheduler.view'], f);\n}(function () {\n var __meta__ = {\n id: 'scheduler.dayview',\n name: 'Scheduler Day View',\n category: 'web',\n description: 'The Scheduler Day View',\n depends: ['scheduler.view'],\n hidden: true\n };\n (function ($, undefined) {\n var kendo = window.kendo, ui = kendo.ui, setTime = kendo.date.setTime, SchedulerView = ui.SchedulerView, outerWidth = kendo._outerWidth, outerHeight = kendo._outerHeight, extend = $.extend, proxy = $.proxy, getDate = kendo.date.getDate, MS_PER_MINUTE = kendo.date.MS_PER_MINUTE, MS_PER_DAY = kendo.date.MS_PER_DAY, CURRENT_TIME_MARKER_CLASS = 'k-current-time', CURRENT_TIME_MARKER_ARROW_CLASS = 'k-current-time-arrow', BORDER_SIZE_COEFF = 0.8666, getMilliseconds = kendo.date.getMilliseconds, NS = '.kendoMultiDayView';\n var DAY_VIEW_EVENT_TEMPLATE = kendo.template('
' + '
#:kendo.format(\"{0:t} - {1:t}\", start, end)#
' + '
${title}
' + '
'), DAY_VIEW_ALL_DAY_EVENT_TEMPLATE = kendo.template('
' + '
${title}
' + '
'), DATA_HEADER_TEMPLATE = kendo.template('#=kendo.toString(date, \\'ddd M/dd\\')#'), ALLDAY_EVENT_WRAPPER_STRING = '
' + '' + '# 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){#' + '' + '#}#' + '
', EVENT_WRAPPER_STRING = '
' + '' + '# 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) {#' + '' + '# } #' + '
';\n function toInvariantTime(date) {\n var staticDate = new Date(1980, 1, 1, 0, 0, 0);\n setTime(staticDate, getMilliseconds(date));\n return staticDate;\n }\n function isInDateRange(value, min, max) {\n return value >= min && value <= max;\n }\n function isInTimeRange(value, min, max, overlaps) {\n overlaps = overlaps ? value <= max : value < max;\n return value > min && overlaps;\n }\n function addContinuousEvent(group, range, element, isAllDay) {\n var events = group._continuousEvents;\n var lastEvent = events[events.length - 1];\n var startDate = getDate(range.start.startDate()).getTime();\n if (isAllDay && lastEvent && getDate(lastEvent.start.startDate()).getTime() == startDate) {\n var idx = events.length - 1;\n for (; idx > -1; idx--) {\n if (events[idx].isAllDay || getDate(events[idx].start.startDate()).getTime() < startDate) {\n break;\n }\n }\n events.splice(idx + 1, 0, {\n element: element,\n isAllDay: true,\n uid: element.attr(kendo.attr('uid')),\n start: range.start,\n end: range.end\n });\n } else {\n events.push({\n element: element,\n isAllDay: isAllDay,\n uid: element.attr(kendo.attr('uid')),\n start: range.start,\n end: range.end\n });\n }\n }\n function getWorkDays(options) {\n var workDays = [];\n var dayIndex = options.workWeekStart;\n workDays.push(dayIndex);\n while (options.workWeekEnd != dayIndex) {\n if (dayIndex > 6) {\n dayIndex -= 7;\n } else {\n dayIndex++;\n }\n workDays.push(dayIndex);\n }\n return workDays;\n }\n var MultiDayView = SchedulerView.extend({\n init: function (element, options) {\n var that = this;\n SchedulerView.fn.init.call(that, element, options);\n that.title = that.options.title || that.options.name;\n that._workDays = getWorkDays(that.options);\n that._templates();\n that._editable();\n that.calculateDateRange();\n that._groups();\n that._currentTime(true);\n },\n _currentTimeMarkerUpdater: function () {\n this._updateCurrentTimeMarker(new Date());\n },\n _updateCurrentTimeMarker: function (currentTime) {\n var options = this.options;\n if (options.currentTimeMarker.useLocalTimezone === false) {\n var timezone = options.dataSource.options.schema.timezone;\n if (options.dataSource && timezone) {\n var timezoneOffset = kendo.timezone.offset(currentTime, timezone);\n currentTime = kendo.timezone.convert(currentTime, currentTime.getTimezoneOffset(), timezoneOffset);\n }\n }\n this.times.find('.' + CURRENT_TIME_MARKER_CLASS).remove();\n this.content.find('.' + CURRENT_TIME_MARKER_CLASS).remove();\n var groupsCount = !options.group || options.group.orientation == 'horizontal' ? 1 : this.groups.length;\n var firstTimesCell = this.times.find('tr:first th:first');\n var lastTimesCell = this.times.find('tr:first th:last');\n for (var groupIndex = 0; groupIndex < groupsCount; groupIndex++) {\n var currentGroup = this.groups[groupIndex];\n if (!currentGroup) {\n return;\n }\n var utcCurrentTime = kendo.date.toUtcTime(currentTime);\n var ranges = currentGroup.timeSlotRanges(utcCurrentTime, utcCurrentTime + 1);\n if (ranges.length === 0) {\n return;\n }\n var collection = ranges[0].collection;\n var slotElement = collection.slotByStartDate(currentTime);\n if (slotElement) {\n var elementHtml = '
';\n var timesTableMarker = $(elementHtml).prependTo(this.times);\n var markerTopPosition = Math.round(ranges[0].innerRect(currentTime, new Date(currentTime.getTime() + 1), false).top);\n var timesTableMarkerCss = {};\n if (this._isRtl) {\n timesTableMarkerCss.right = firstTimesCell.position().left + outerHeight(firstTimesCell) - outerHeight(lastTimesCell);\n timesTableMarker.addClass(CURRENT_TIME_MARKER_ARROW_CLASS + '-left');\n } else {\n timesTableMarkerCss.left = lastTimesCell.position().left;\n timesTableMarker.addClass(CURRENT_TIME_MARKER_ARROW_CLASS + '-right');\n }\n timesTableMarkerCss.top = markerTopPosition - outerWidth(timesTableMarker) * BORDER_SIZE_COEFF / 2;\n timesTableMarker.css(timesTableMarkerCss);\n $(elementHtml).prependTo(this.content).css({\n top: markerTopPosition,\n height: '1px',\n right: '1px',\n width: this.content[0].scrollWidth,\n left: 0\n });\n }\n }\n },\n _currentTime: function (setUpdateTimer) {\n var that = this;\n var markerOptions = that.options.currentTimeMarker;\n if (markerOptions !== false && markerOptions.updateInterval !== undefined) {\n that._currentTimeMarkerUpdater();\n if (setUpdateTimer) {\n that._currentTimeUpdateTimer = setInterval(proxy(this._currentTimeMarkerUpdater, that), markerOptions.updateInterval);\n }\n }\n },\n _updateResizeHint: function (event, groupIndex, startTime, endTime) {\n var multiday = event.isMultiDay();\n var group = this.groups[groupIndex];\n var ranges = group.ranges(startTime, endTime, multiday, event.isAllDay);\n var width, height, top, hint;\n this._removeResizeHint();\n for (var rangeIndex = 0; rangeIndex < ranges.length; rangeIndex++) {\n var range = ranges[rangeIndex];\n var start = range.startSlot();\n if (this._isGroupedByDate() && multiday) {\n for (var slotIdx = start.index; slotIdx <= range.end.index; slotIdx++) {\n var slot = range.collection._slots[slotIdx];\n width = slot.offsetWidth;\n height = slot.clientHeight;\n top = slot.offsetTop;\n hint = SchedulerView.fn._createResizeHint.call(this, slot.offsetLeft, top, width, height);\n this._resizeHint = this._resizeHint.add(hint);\n }\n } else {\n width = start.offsetWidth;\n height = start.clientHeight;\n top = start.offsetTop;\n if (multiday) {\n width = range.innerWidth();\n } else {\n var rect = range.outerRect(startTime, endTime, this.options.snap);\n top = rect.top;\n height = rect.bottom - rect.top;\n }\n hint = SchedulerView.fn._createResizeHint.call(this, start.offsetLeft, top, width, height);\n this._resizeHint = this._resizeHint.add(hint);\n }\n }\n var format = 't';\n var container = this.content;\n if (multiday) {\n format = 'M/dd';\n container = this.element.find('.k-scheduler-header-wrap:has(.k-scheduler-header-all-day) > div');\n if (!container.length) {\n container = this.content;\n }\n }\n this._resizeHint.appendTo(container);\n this._resizeHint.find('.k-label-top,.k-label-bottom').text('');\n this._resizeHint.first().addClass('k-first').find('.k-label-top').text(kendo.toString(kendo.timezone.toLocalDate(startTime), format));\n this._resizeHint.last().addClass('k-last').find('.k-label-bottom').text(kendo.toString(kendo.timezone.toLocalDate(endTime), format));\n },\n _updateMoveHint: function (event, groupIndex, distance) {\n var multiday = event.isMultiDay();\n var group = this.groups[groupIndex];\n var start = kendo.date.toUtcTime(event.start) + distance;\n var end = start + event.duration();\n var ranges = group.ranges(start, end, multiday, event.isAllDay);\n start = kendo.timezone.toLocalDate(start);\n end = kendo.timezone.toLocalDate(end);\n this._removeMoveHint();\n if (!multiday && (getMilliseconds(end) === 0 || getMilliseconds(end) < getMilliseconds(this.startTime()))) {\n if (ranges.length > 1) {\n ranges.pop();\n }\n }\n for (var rangeIndex = 0; rangeIndex < ranges.length; rangeIndex++) {\n var range = ranges[rangeIndex];\n var startSlot = range.start;\n var hint;\n var css = {\n left: startSlot.offsetLeft + 2,\n top: startSlot.offsetTop\n };\n if (this._isGroupedByDate() && multiday) {\n for (var slotIdx = startSlot.index; slotIdx <= range.end.index; slotIdx++) {\n var slot = range.collection._slots[slotIdx];\n css.left = this._isRtl ? slot.clientWidth * 0.1 + slot.offsetLeft + 2 : slot.offsetLeft + 2;\n css.height = slot.offsetHeight;\n css.width = slot.clientWidth * 0.9 - 4;\n hint = this._createEventElement(event.clone({\n start: start,\n end: end\n }), !multiday);\n this._appendMoveHint(hint, css);\n }\n } else {\n if (this._isRtl) {\n css.left = startSlot.clientWidth * 0.1 + startSlot.offsetLeft + 2;\n }\n if (multiday) {\n css.width = range.innerWidth() - 4;\n } else {\n var rect = range.outerRect(start, end, this.options.snap);\n css.top = rect.top;\n css.height = rect.bottom - rect.top;\n css.width = startSlot.clientWidth * 0.9 - 4;\n }\n hint = this._createEventElement(event.clone({\n start: start,\n end: end\n }), !multiday);\n this._appendMoveHint(hint, css);\n }\n }\n var content = this.content;\n if (multiday) {\n content = this.element.find('.k-scheduler-header-wrap:has(.k-scheduler-header-all-day) > div');\n if (!content.length) {\n content = this.content;\n }\n }\n this._moveHint.appendTo(content);\n },\n _appendMoveHint: function (hint, css) {\n hint.addClass('k-event-drag-hint');\n hint.css(css);\n this._moveHint = this._moveHint.add(hint);\n },\n _slotByPosition: function (x, y) {\n var slot, offset;\n if (this._isVerticallyGrouped()) {\n offset = this.content.offset();\n y += this.content[0].scrollTop;\n x += this.content[0].scrollLeft;\n } else {\n offset = this.element.find('.k-scheduler-header-wrap:has(.k-scheduler-header-all-day)').find('>div').offset();\n }\n if (offset) {\n x -= offset.left;\n y -= offset.top;\n }\n x = Math.ceil(x);\n y = Math.ceil(y);\n var group;\n var groupIndex;\n for (groupIndex = 0; groupIndex < this.groups.length; groupIndex++) {\n group = this.groups[groupIndex];\n slot = group.daySlotByPosition(x, y, this._isGroupedByDate());\n if (slot) {\n return slot;\n }\n }\n if (offset) {\n x += offset.left;\n y += offset.top;\n }\n offset = this.content.offset();\n x -= offset.left;\n y -= offset.top;\n if (!this._isVerticallyGrouped()) {\n y += this.content[0].scrollTop;\n x += this.content[0].scrollLeft;\n }\n x = Math.ceil(x);\n y = Math.ceil(y);\n for (groupIndex = 0; groupIndex < this.groups.length; groupIndex++) {\n group = this.groups[groupIndex];\n slot = group.timeSlotByPosition(x, y);\n if (slot) {\n return slot;\n }\n }\n return null;\n },\n _groupCount: function () {\n var resources = this.groupedResources;\n var byDate = this._isGroupedByDate();\n if (resources.length) {\n if (this._groupOrientation() === 'vertical') {\n if (byDate) {\n return this._columnCountForLevel(resources.length - 1);\n } else {\n return this._rowCountForLevel(resources.length - 1);\n }\n } else {\n if (byDate) {\n return this._columnCountForLevel(resources.length) / this._columnCountForLevel(0);\n } else {\n return this._columnCountForLevel(resources.length) / this._columnOffsetForResource(resources.length);\n }\n }\n }\n return 1;\n },\n _columnCountInResourceView: function () {\n var resources = this.groupedResources;\n var byDate = this._isGroupedByDate();\n if (!resources.length || this._isVerticallyGrouped()) {\n if (byDate) {\n return this._rowCountForLevel(0);\n } else {\n return this._columnCountForLevel(0);\n }\n }\n if (byDate) {\n return this._columnCountForLevel(0);\n } else {\n return this._columnOffsetForResource(resources.length);\n }\n },\n _timeSlotGroups: function (groupCount, columnCount) {\n var interval = this._timeSlotInterval();\n var verticalViews = groupCount;\n var byDate = this._isGroupedByDate();\n var tableRows = this.content.find('tr:not(.k-scheduler-header-all-day)');\n var group, time, rowIndex, cellIndex;\n tableRows.attr('role', 'row');\n var rowCount = tableRows.length;\n if (this._isVerticallyGrouped()) {\n if (byDate) {\n verticalViews = columnCount;\n }\n rowCount = Math.floor(rowCount / verticalViews);\n }\n for (var groupIndex = 0; groupIndex < verticalViews; groupIndex++) {\n var rowMultiplier = 0;\n var cellMultiplier = 0;\n if (this._isVerticallyGrouped()) {\n rowMultiplier = groupIndex;\n } else {\n cellMultiplier = groupIndex;\n }\n rowIndex = rowMultiplier * rowCount;\n while (rowIndex < (rowMultiplier + 1) * rowCount) {\n var cells = tableRows[rowIndex].children;\n if (rowIndex % rowCount === 0) {\n time = getMilliseconds(new Date(+this.startTime()));\n }\n var timeIndex = 0;\n if (byDate) {\n if (this._isVerticallyGrouped()) {\n for (cellIndex = 0; cellIndex < groupCount; cellIndex++) {\n group = this.groups[cellIndex];\n this._addTimeSlotGroup(group, cells, cellIndex, time, interval, groupIndex);\n }\n } else {\n group = this.groups[groupIndex];\n for (cellIndex = cellMultiplier; cellIndex < groupCount * columnCount; cellIndex = cellIndex + groupCount) {\n this._addTimeSlotGroup(group, cells, cellIndex, time, interval, timeIndex);\n timeIndex++;\n }\n }\n } else {\n group = this.groups[groupIndex];\n for (cellIndex = cellMultiplier * columnCount; cellIndex < (cellMultiplier + 1) * columnCount; cellIndex++) {\n this._addTimeSlotGroup(group, cells, cellIndex, time, interval, timeIndex);\n timeIndex++;\n }\n }\n time += interval;\n rowIndex++;\n }\n }\n },\n _addTimeSlotGroup: function (group, cells, cellIndex, time, interval, timeIndex) {\n var cell = cells[cellIndex];\n var collection = group.getTimeSlotCollection(timeIndex);\n var currentDate = this._dates[timeIndex];\n var currentTime = Date.UTC(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate());\n var start = currentTime + time;\n var end = start + interval;\n cell.setAttribute('role', 'gridcell');\n cell.setAttribute('aria-selected', false);\n collection.addTimeSlot(cell, start, end);\n },\n _addDaySlotGroup: function (collection, cells, cellIndex, columnCount, cellCount) {\n var cell = cells[cellIndex];\n var start = this._dates[cellCount];\n var currentTime = Date.UTC(start.getFullYear(), start.getMonth(), start.getDate());\n cell.setAttribute('role', 'gridcell');\n cell.setAttribute('aria-selected', false);\n collection.addDaySlot(cell, currentTime, currentTime + kendo.date.MS_PER_DAY);\n },\n _daySlotGroups: function (groupCount, columnCount) {\n var tableRows, cellIndex;\n var verticalViews = groupCount;\n var byDate = this._isGroupedByDate();\n if (this._isVerticallyGrouped()) {\n if (byDate) {\n verticalViews = columnCount;\n }\n tableRows = this.element.find('.k-scheduler-header-all-day');\n } else {\n tableRows = this.element.find('.k-scheduler-header-all-day tr');\n }\n tableRows.attr('role', 'row');\n for (var groupIndex = 0; groupIndex < verticalViews; groupIndex++) {\n var rowMultiplier = 0;\n var group, collection;\n if (this._isVerticallyGrouped()) {\n rowMultiplier = groupIndex;\n }\n var cells = tableRows[rowMultiplier].children;\n var cellMultiplier = 0;\n if (!this._isVerticallyGrouped()) {\n cellMultiplier = groupIndex;\n }\n var cellCount = 0;\n if (byDate) {\n if (this._isVerticallyGrouped()) {\n for (cellIndex = 0; cellIndex < groupCount; cellIndex++) {\n group = this.groups[cellIndex];\n collection = group.getDaySlotCollection(0);\n this._addDaySlotGroup(collection, cells, cellIndex, columnCount, groupIndex);\n }\n } else {\n group = this.groups[groupIndex];\n collection = group.getDaySlotCollection(0);\n for (cellIndex = cellMultiplier; cellIndex < groupCount * columnCount; cellIndex = cellIndex + groupCount) {\n this._addDaySlotGroup(collection, cells, cellIndex, columnCount, cellCount);\n cellCount++;\n }\n }\n } else {\n group = this.groups[groupIndex];\n collection = group.getDaySlotCollection(0);\n for (cellIndex = cellMultiplier * columnCount; cellIndex < (cellMultiplier + 1) * columnCount; cellIndex++) {\n this._addDaySlotGroup(collection, cells, cellIndex, columnCount, cellCount);\n cellCount++;\n }\n }\n }\n },\n _groups: function () {\n var groupCount = this._groupCount();\n var columnCount = this._columnCountInResourceView();\n this.groups = [];\n for (var idx = 0; idx < groupCount; idx++) {\n var view = this._addResourceView(idx);\n for (var columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n view.addTimeSlotCollection(this._dates[columnIndex], kendo.date.addDays(this._dates[columnIndex], 1));\n }\n if (this.options.allDaySlot) {\n view.addDaySlotCollection(this._dates[0], kendo.date.addDays(this._dates[this._dates.length - 1], 1));\n }\n }\n this._timeSlotGroups(groupCount, columnCount);\n if (this.options.allDaySlot) {\n this._daySlotGroups(groupCount, columnCount);\n }\n },\n options: {\n name: 'MultiDayView',\n selectedDateFormat: '{0:D}',\n selectedShortDateFormat: '{0:d}',\n allDaySlot: true,\n showWorkHours: false,\n title: '',\n startTime: kendo.date.today(),\n endTime: kendo.date.today(),\n minorTickCount: 2,\n majorTick: 60,\n majorTimeHeaderTemplate: '#=kendo.toString(date, \\'t\\')#',\n minorTimeHeaderTemplate: ' ',\n groupHeaderTemplate: '#=text#',\n slotTemplate: ' ',\n allDaySlotTemplate: ' ',\n eventTemplate: DAY_VIEW_EVENT_TEMPLATE,\n allDayEventTemplate: DAY_VIEW_ALL_DAY_EVENT_TEMPLATE,\n dateHeaderTemplate: DATA_HEADER_TEMPLATE,\n editable: true,\n workDayStart: new Date(1980, 1, 1, 8, 0, 0),\n workDayEnd: new Date(1980, 1, 1, 17, 0, 0),\n workWeekStart: 1,\n workWeekEnd: 5,\n footer: { command: 'workDay' },\n messages: {\n allDay: 'all day',\n showFullDay: 'Show full day',\n showWorkDay: 'Show business hours'\n },\n currentTimeMarker: {\n updateInterval: 10000,\n useLocalTimezone: true\n }\n },\n events: [\n 'remove',\n 'add',\n 'edit'\n ],\n _templates: function () {\n var options = this.options, settings = extend({}, kendo.Template, options.templateSettings);\n this.eventTemplate = this._eventTmpl(options.eventTemplate, EVENT_WRAPPER_STRING);\n this.allDayEventTemplate = this._eventTmpl(options.allDayEventTemplate, ALLDAY_EVENT_WRAPPER_STRING);\n this.majorTimeHeaderTemplate = kendo.template(options.majorTimeHeaderTemplate, settings);\n this.minorTimeHeaderTemplate = kendo.template(options.minorTimeHeaderTemplate, settings);\n this.dateHeaderTemplate = kendo.template(options.dateHeaderTemplate, settings);\n this.slotTemplate = kendo.template(options.slotTemplate, settings);\n this.allDaySlotTemplate = kendo.template(options.allDaySlotTemplate, settings);\n this.groupHeaderTemplate = kendo.template(options.groupHeaderTemplate, settings);\n },\n _editable: function () {\n if (this.options.editable) {\n if (this._isMobile()) {\n this._touchEditable();\n } else {\n this._mouseEditable();\n }\n }\n },\n _mouseEditable: function () {\n var that = this;\n that.element.on('click' + NS, '.k-event a:has(.k-si-close)', function (e) {\n that.trigger('remove', { uid: $(this).closest('.k-event').attr(kendo.attr('uid')) });\n e.preventDefault();\n });\n if (that.options.editable.create !== false) {\n that.element.on('dblclick' + NS, '.k-scheduler-content td', function (e) {\n if (!$(this).parent().hasClass('k-scheduler-header-all-day')) {\n var slot = that._slotByPosition(e.pageX, e.pageY);\n if (slot) {\n var resourceInfo = that._resourceBySlot(slot);\n that.trigger('add', {\n eventInfo: extend({\n start: slot.startDate(),\n end: slot.endDate()\n }, resourceInfo)\n });\n }\n e.preventDefault();\n }\n }).on('dblclick' + NS, '.k-scheduler-header-all-day td', function (e) {\n var slot = that._slotByPosition(e.pageX, e.pageY);\n if (slot) {\n var resourceInfo = that._resourceBySlot(slot);\n that.trigger('add', {\n eventInfo: extend({}, {\n isAllDay: true,\n start: kendo.date.getDate(slot.startDate()),\n end: kendo.date.getDate(slot.startDate())\n }, resourceInfo)\n });\n }\n e.preventDefault();\n });\n }\n if (that.options.editable.update !== false) {\n that.element.on('dblclick' + NS, '.k-event', function (e) {\n that.trigger('edit', { uid: $(this).closest('.k-event').attr(kendo.attr('uid')) });\n e.preventDefault();\n });\n }\n },\n _touchEditable: function () {\n var that = this;\n var threshold = 0;\n if (kendo.support.mobileOS.android) {\n threshold = 5;\n }\n if (that.options.editable.create !== false) {\n that._addUserEvents = new kendo.UserEvents(that.element, {\n threshold: threshold,\n filter: '.k-scheduler-content td',\n tap: function (e) {\n if (!$(e.target).parent().hasClass('k-scheduler-header-all-day')) {\n var x = e.x.location !== undefined ? e.x.location : e.x;\n var y = e.y.location !== undefined ? e.y.location : e.y;\n var slot = that._slotByPosition(x, y);\n if (slot) {\n var resourceInfo = that._resourceBySlot(slot);\n that.trigger('add', {\n eventInfo: extend({\n start: slot.startDate(),\n end: slot.endDate()\n }, resourceInfo)\n });\n }\n e.preventDefault();\n }\n }\n });\n that._allDayUserEvents = new kendo.UserEvents(that.element, {\n threshold: threshold,\n filter: '.k-scheduler-header-all-day td',\n tap: function (e) {\n var x = e.x.location !== undefined ? e.x.location : e.x;\n var y = e.y.location !== undefined ? e.y.location : e.y;\n var slot = that._slotByPosition(x, y);\n if (slot) {\n var resourceInfo = that._resourceBySlot(slot);\n that.trigger('add', {\n eventInfo: extend({}, {\n isAllDay: true,\n start: kendo.date.getDate(slot.startDate()),\n end: kendo.date.getDate(slot.startDate())\n }, resourceInfo)\n });\n }\n e.preventDefault();\n }\n });\n }\n if (that.options.editable.update !== false) {\n that._editUserEvents = new kendo.UserEvents(that.element, {\n threshold: threshold,\n filter: '.k-event',\n tap: function (e) {\n var eventElement = $(e.target).closest('.k-event');\n if (!eventElement.hasClass('k-event-active')) {\n that.trigger('edit', { uid: eventElement.attr(kendo.attr('uid')) });\n }\n e.preventDefault();\n }\n });\n }\n },\n _layout: function (dates) {\n var columns = [];\n var rows = [];\n var options = this.options;\n var that = this;\n var byDate = that._isGroupedByDate();\n for (var idx = 0; idx < dates.length; idx++) {\n var column = {};\n column.text = that.dateHeaderTemplate({ date: dates[idx] });\n if (kendo.date.isToday(dates[idx])) {\n column.className = 'k-today';\n }\n columns.push(column);\n }\n var resources = this.groupedResources;\n if (options.allDaySlot) {\n rows.push({\n text: options.messages.allDay,\n allDay: true,\n cellContent: function (idx) {\n var groupIndex = idx;\n idx = resources.length && that._groupOrientation() !== 'vertical' ? idx % dates.length : idx;\n return that.allDaySlotTemplate({\n date: dates[idx],\n resources: function () {\n return that._resourceBySlot({ groupIndex: groupIndex });\n }\n });\n }\n });\n }\n this._forTimeRange(this.startTime(), this.endTime(), function (date, majorTick, middleRow, lastSlotRow) {\n var template = majorTick ? that.majorTimeHeaderTemplate : that.minorTimeHeaderTemplate;\n var row = {\n text: template({ date: date }),\n className: lastSlotRow ? 'k-slot-cell' : ''\n };\n rows.push(row);\n });\n if (resources.length) {\n if (this._groupOrientation() === 'vertical') {\n if (byDate) {\n rows = this._createDateLayout(columns, rows);\n columns = this._createColumnsLayout(resources, null, this.groupHeaderTemplate);\n } else {\n rows = this._createRowsLayout(resources, rows, this.groupHeaderTemplate);\n }\n } else {\n if (byDate) {\n columns = this._createColumnsLayout(resources, columns, this.groupHeaderTemplate, columns);\n } else {\n columns = this._createColumnsLayout(resources, columns, this.groupHeaderTemplate);\n }\n }\n }\n return {\n columns: columns,\n rows: rows\n };\n },\n _footer: function () {\n var options = this.options;\n if (options.footer !== false) {\n var html = '
';\n var command = options.footer.command;\n if (command && command === 'workDay') {\n html += '';\n } else {\n html += ' ';\n }\n html += '
';\n this.footer = $(html).appendTo(this.element);\n var that = this;\n this.footer.on('click' + NS, '.k-scheduler-fullday', function (e) {\n e.preventDefault();\n that.trigger('navigate', {\n view: that.name || options.name,\n date: that.startDate(),\n isWorkDay: !options.showWorkHours\n });\n });\n }\n },\n _forTimeRange: function (min, max, action, after) {\n min = toInvariantTime(min);\n max = toInvariantTime(max);\n var that = this, msMin = getMilliseconds(min), msMax = getMilliseconds(max), minorTickCount = that.options.minorTickCount, msMajorInterval = that.options.majorTick * MS_PER_MINUTE, msInterval = msMajorInterval / minorTickCount || 1, start = new Date(+min), startDay = start.getDate(), msStart, idx = 0, length, html = '';\n length = MS_PER_DAY / msInterval;\n if (msMin != msMax) {\n if (msMin > msMax) {\n msMax += MS_PER_DAY;\n }\n length = (msMax - msMin) / msInterval;\n }\n length = Math.round(length);\n for (; idx < length; idx++) {\n var majorTickDivider = idx % (msMajorInterval / msInterval), isMajorTickRow = majorTickDivider === 0, isMiddleRow = majorTickDivider < minorTickCount - 1, isLastSlotRow = majorTickDivider === minorTickCount - 1;\n html += action(start, isMajorTickRow, isMiddleRow, isLastSlotRow);\n setTime(start, msInterval, false);\n }\n if (msMax) {\n msStart = getMilliseconds(start);\n if (startDay < start.getDate()) {\n msStart += MS_PER_DAY;\n }\n if (msStart > msMax) {\n start = new Date(+max);\n }\n }\n if (after) {\n html += after(start);\n }\n return html;\n },\n _content: function (dates) {\n var that = this;\n var options = that.options;\n var start = that.startTime();\n var end = this.endTime();\n var groupsCount = 1;\n var rowCount = 1;\n var columnCount = dates.length;\n var html = '';\n var resources = this.groupedResources;\n var allDaySlotTemplate = this.allDaySlotTemplate;\n var isVerticalGroupped = false;\n var allDayVerticalGroupRow;\n var byDate = that._isGroupedByDate();\n var dateID = 0;\n if (resources.length) {\n isVerticalGroupped = that._groupOrientation() === 'vertical';\n if (isVerticalGroupped) {\n rowCount = this._rowCountForLevel(this.rowLevels.length - 2);\n if (byDate) {\n groupsCount = this._columnCountForLevel(this.columnLevels.length - 1);\n }\n if (options.allDaySlot) {\n allDayVerticalGroupRow = function (groupIndex) {\n var result = '';\n var dateGroupIndex = byDate ? 0 : groupIndex;\n var resources = function () {\n return that._resourceBySlot({ groupIndex: dateGroupIndex });\n };\n if (byDate) {\n for (; dateGroupIndex < groupsCount; dateGroupIndex++) {\n result += '' + allDaySlotTemplate({\n date: dates[dateID],\n resources: resources\n }) + '';\n }\n } else {\n for (var idx = 0; idx < dates.length; idx++) {\n result += '' + allDaySlotTemplate({\n date: dates[idx],\n resources: resources\n }) + '';\n }\n }\n return result + '';\n };\n }\n } else {\n if (byDate) {\n groupsCount = this._columnCountForLevel(this.columnLevels.length - 1) / this._columnCountForLevel(0);\n } else {\n groupsCount = this._columnCountForLevel(this.columnLevels.length - 2);\n }\n }\n }\n html += '';\n var appendRow = function (date, majorTick) {\n var content = '';\n var groupIdx = 0;\n var idx, length;\n content = '';\n if (byDate) {\n for (idx = 0, length = columnCount; idx < length; idx++) {\n for (groupIdx = 0; groupIdx < groupsCount; groupIdx++) {\n var dateIndex = idx;\n if (isVerticalGroupped) {\n dateIndex = dateID;\n }\n content = that._addCellsToContent(content, dates, date, dateIndex, groupIdx, rowIdx);\n }\n if (isVerticalGroupped) {\n break;\n }\n }\n } else {\n for (; groupIdx < groupsCount; groupIdx++) {\n for (idx = 0, length = columnCount; idx < length; idx++) {\n content = that._addCellsToContent(content, dates, date, idx, groupIdx, rowIdx);\n }\n }\n }\n content += '';\n return content;\n };\n for (var rowIdx = 0; rowIdx < rowCount; rowIdx++) {\n html += allDayVerticalGroupRow ? allDayVerticalGroupRow(rowIdx) : '';\n html += this._forTimeRange(start, end, appendRow);\n if (isVerticalGroupped) {\n dateID++;\n }\n }\n html += '';\n this.content.find('table').append(html);\n },\n _addCellsToContent: function (content, dates, date, idx, groupIdx, rowIdx) {\n var that = this;\n var classes = '';\n var tmplDate;\n var slotTemplate = this.slotTemplate;\n var isVerticalGroupped = this._groupOrientation() === 'vertical';\n var resources = function (groupIndex) {\n return function () {\n return that._resourceBySlot({ groupIndex: groupIndex });\n };\n };\n if (kendo.date.isToday(dates[idx])) {\n classes += 'k-today';\n }\n if (kendo.date.getMilliseconds(date) < kendo.date.getMilliseconds(this.options.workDayStart) || kendo.date.getMilliseconds(date) >= kendo.date.getMilliseconds(this.options.workDayEnd) || !this._isWorkDay(dates[idx])) {\n classes += ' k-nonwork-hour';\n }\n content += '';\n tmplDate = kendo.date.getDate(dates[idx]);\n kendo.date.setTime(tmplDate, kendo.date.getMilliseconds(date));\n content += slotTemplate({\n date: tmplDate,\n resources: resources(isVerticalGroupped && !that._isGroupedByDate() ? rowIdx : groupIdx)\n });\n content += '';\n return content;\n },\n _isWorkDay: function (date) {\n var day = date.getDay();\n var workDays = this._workDays;\n for (var i = 0; i < workDays.length; i++) {\n if (workDays[i] === day) {\n return true;\n }\n }\n return false;\n },\n _render: function (dates) {\n var that = this;\n dates = dates || [];\n this._dates = dates;\n this._startDate = dates[0];\n this._endDate = dates[dates.length - 1 || 0];\n this.createLayout(this._layout(dates));\n this._content(dates);\n this._footer();\n this.refreshLayout();\n var allDayHeader = this.element.find('.k-scheduler-header-all-day td');\n if (allDayHeader.length) {\n this._allDayHeaderHeight = allDayHeader.first()[0].clientHeight;\n }\n that.element.on('click' + NS, '.k-nav-day', function (e) {\n var th = $(e.currentTarget).closest('th');\n var offset = th.offset();\n var additioanlWidth = 0;\n var additionalHeight = outerHeight(th);\n if (that._isGroupedByDate()) {\n if (that._isVerticallyGrouped()) {\n additioanlWidth = outerWidth(that.times);\n additionalHeight = 0;\n } else {\n additionalHeight = outerHeight(that.datesHeader);\n }\n }\n var slot = that._slotByPosition(offset.left + additioanlWidth, offset.top + additionalHeight);\n that.trigger('navigate', {\n view: 'day',\n date: slot.startDate()\n });\n });\n },\n startTime: function () {\n var options = this.options;\n return options.showWorkHours ? options.workDayStart : options.startTime;\n },\n endTime: function () {\n var options = this.options;\n return options.showWorkHours ? options.workDayEnd : options.endTime;\n },\n startDate: function () {\n return this._startDate;\n },\n endDate: function () {\n return this._endDate;\n },\n _end: function (isAllDay) {\n var time = getMilliseconds(this.endTime()) || MS_PER_DAY;\n if (isAllDay) {\n time = 0;\n }\n return new Date(this._endDate.getTime() + time);\n },\n nextDate: function () {\n return kendo.date.nextDay(this.endDate());\n },\n previousDate: function () {\n return kendo.date.previousDay(this.startDate());\n },\n calculateDateRange: function () {\n this._render([this.options.date]);\n },\n destroy: function () {\n var that = this;\n if (that._currentTimeUpdateTimer) {\n clearInterval(that._currentTimeUpdateTimer);\n }\n if (that.datesHeader) {\n that.datesHeader.off(NS);\n }\n if (that.element) {\n that.element.off(NS);\n }\n if (that.footer) {\n that.footer.remove();\n }\n SchedulerView.fn.destroy.call(this);\n if (this._isMobile() && that.options.editable) {\n if (that.options.editable.create !== false) {\n that._addUserEvents.destroy();\n that._allDayUserEvents.destroy();\n }\n if (that.options.editable.update !== false) {\n that._editUserEvents.destroy();\n }\n }\n },\n inRange: function (options) {\n var inRange = SchedulerView.fn.inRange.call(this, options);\n if (options.isAllDay) {\n return inRange;\n }\n var startTime = getMilliseconds(this.startTime());\n var endTime = getMilliseconds(this.endTime()) || kendo.date.MS_PER_DAY;\n var start = getMilliseconds(options.start);\n var end = getMilliseconds(options.end) || kendo.date.MS_PER_DAY;\n return inRange && startTime <= start && end <= endTime;\n },\n selectionByElement: function (cell) {\n var offset = cell.offset();\n return this._slotByPosition(offset.left, offset.top);\n },\n _timeSlotInterval: function () {\n var options = this.options;\n return options.majorTick / options.minorTickCount * MS_PER_MINUTE;\n },\n _timeSlotIndex: function (date) {\n var options = this.options;\n var eventStartTime = getMilliseconds(date);\n var startTime = getMilliseconds(this.startTime());\n var timeSlotInterval = options.majorTick / options.minorTickCount * MS_PER_MINUTE;\n return (eventStartTime - startTime) / timeSlotInterval;\n },\n _slotIndex: function (date, multiday) {\n if (multiday) {\n return this._dateSlotIndex(date);\n }\n return this._timeSlotIndex(date);\n },\n _dateSlotIndex: function (date, overlaps) {\n var idx;\n var length;\n var slots = this._dates || [];\n var slotStart;\n var slotEnd;\n var offset = 1;\n for (idx = 0, length = slots.length; idx < length; idx++) {\n slotStart = kendo.date.getDate(slots[idx]);\n slotEnd = new Date(kendo.date.getDate(slots[idx]).getTime() + MS_PER_DAY - (overlaps ? 0 : 1));\n if (isInDateRange(date, slotStart, slotEnd)) {\n return idx * offset;\n }\n }\n return -1;\n },\n _positionAllDayEvent: function (element, slotRange) {\n var slotWidth = slotRange.innerWidth();\n var startIndex = slotRange.start.index;\n var endIndex = slotRange.end.index;\n var allDayEvents = SchedulerView.collidingEvents(slotRange.events(), startIndex, endIndex);\n var currentColumnCount = this._headerColumnCount || 0;\n var leftOffset = 2;\n var rightOffset = startIndex !== endIndex ? 5 : 4;\n var eventHeight = this._allDayHeaderHeight;\n var start = slotRange.startSlot();\n element.css({\n left: start.offsetLeft + leftOffset,\n width: slotWidth - rightOffset\n });\n slotRange.addEvent({\n slotIndex: startIndex,\n start: startIndex,\n end: endIndex,\n element: element\n });\n allDayEvents.push({\n slotIndex: startIndex,\n start: startIndex,\n end: endIndex,\n element: element\n });\n var rows = SchedulerView.createRows(allDayEvents);\n if (rows.length && rows.length > currentColumnCount) {\n this._headerColumnCount = rows.length;\n }\n var top = slotRange.start.offsetTop;\n for (var idx = 0, length = rows.length; idx < length; idx++) {\n var rowEvents = rows[idx].events;\n for (var j = 0, eventLength = rowEvents.length; j < eventLength; j++) {\n $(rowEvents[j].element).css({ top: top + idx * eventHeight });\n }\n }\n },\n _arrangeColumns: function (element, top, height, slotRange) {\n var startSlot = slotRange.start;\n element = {\n element: element,\n slotIndex: startSlot.index,\n start: top,\n end: top + height\n };\n var columns, slotWidth = startSlot.clientWidth, eventRightOffset = slotWidth * 0.1, columnEvents, eventElements = slotRange.events(), slotEvents = SchedulerView.collidingEvents(eventElements, element.start, element.end);\n slotRange.addEvent(element);\n slotEvents.push(element);\n columns = SchedulerView.createColumns(slotEvents);\n var columnWidth = (slotWidth - eventRightOffset) / columns.length;\n for (var idx = 0, length = columns.length; idx < length; idx++) {\n columnEvents = columns[idx].events;\n for (var j = 0, eventLength = columnEvents.length; j < eventLength; j++) {\n columnEvents[j].element[0].style.width = columnWidth - 4 + 'px';\n columnEvents[j].element[0].style.left = (this._isRtl ? eventRightOffset : 0) + startSlot.offsetLeft + idx * columnWidth + 2 + 'px';\n }\n }\n },\n _positionEvent: function (event, element, slotRange) {\n var start = event._startTime || event.start;\n var end = event._endTime || event.end;\n var rect = slotRange.innerRect(start, end, false);\n var height = rect.bottom - rect.top - 2;\n if (height < 0) {\n height = 0;\n }\n element.css({\n top: rect.top,\n height: height\n });\n this._arrangeColumns(element, rect.top, element[0].clientHeight, slotRange);\n },\n _createEventElement: function (event, isOneDayEvent, head, tail) {\n var template = isOneDayEvent ? this.eventTemplate : this.allDayEventTemplate;\n var options = this.options;\n var editable = options.editable;\n var isMobile = this._isMobile();\n var showDelete = editable && editable.destroy !== false && !isMobile;\n var resizable = editable && editable.resize !== false;\n var startDate = getDate(this.startDate());\n var endDate = getDate(this.endDate());\n var startTime = getMilliseconds(this.startTime());\n var endTime = getMilliseconds(this.endTime());\n var eventStartTime = event._time('start');\n var eventEndTime = event._time('end');\n var middle;\n if (startTime >= endTime) {\n endTime = getMilliseconds(new Date(this.endTime().getTime() + MS_PER_DAY - 1));\n }\n if (!isOneDayEvent && !event.isAllDay) {\n endDate = new Date(endDate.getTime() + MS_PER_DAY);\n }\n var eventStartDate = event.start;\n var eventEndDate = event.end;\n if (event.isAllDay) {\n eventEndDate = getDate(event.end);\n }\n if (!isInDateRange(getDate(eventStartDate), startDate, endDate) && !isInDateRange(eventEndDate, startDate, endDate) || isOneDayEvent && eventStartTime < startTime && eventEndTime > endTime) {\n middle = true;\n } else if (getDate(eventStartDate) < startDate || isOneDayEvent && eventStartTime < startTime) {\n tail = true;\n } else if (eventEndDate > endDate && !isOneDayEvent || isOneDayEvent && eventEndTime > endTime) {\n head = true;\n }\n var resources = this.eventResources(event);\n if (event._startTime && eventStartTime !== kendo.date.getMilliseconds(event.start)) {\n eventStartDate = new Date(eventStartTime);\n eventStartDate = kendo.timezone.apply(eventStartDate, 'Etc/UTC');\n }\n if (event._endTime && eventEndTime !== kendo.date.getMilliseconds(event.end)) {\n eventEndDate = new Date(eventEndTime);\n eventEndDate = kendo.timezone.apply(eventEndDate, 'Etc/UTC');\n }\n var data = extend({}, {\n ns: kendo.ns,\n resizable: resizable,\n showDelete: showDelete,\n middle: middle,\n head: head,\n tail: tail,\n singleDay: this._dates.length == 1,\n resources: resources,\n inverseColor: resources && resources[0] ? this._shouldInverseResourceColor(resources[0]) : false\n }, event, {\n start: eventStartDate,\n end: eventEndDate\n });\n var element = $(template(data));\n this.angular('compile', function () {\n return {\n elements: element,\n data: [{ dataItem: data }]\n };\n });\n return element;\n },\n _isInTimeSlot: function (event) {\n var slotStartTime = this.startTime(), slotEndTime = this.endTime(), startTime = event._startTime || event.start, endTime = event._endTime || event.end;\n if (getMilliseconds(slotEndTime) === getMilliseconds(kendo.date.getDate(slotEndTime))) {\n slotEndTime = kendo.date.getDate(slotEndTime);\n setTime(slotEndTime, MS_PER_DAY - 1);\n }\n if (event._date('end') > event._date('start')) {\n endTime = +event._date('end') + (MS_PER_DAY - 1);\n }\n endTime = endTime - event._date('end');\n startTime = startTime - event._date('start');\n slotEndTime = getMilliseconds(slotEndTime);\n slotStartTime = getMilliseconds(slotStartTime);\n if (slotStartTime === startTime && startTime === endTime) {\n return true;\n }\n var overlaps = startTime !== slotEndTime;\n return isInTimeRange(startTime, slotStartTime, slotEndTime, overlaps) || isInTimeRange(endTime, slotStartTime, slotEndTime, overlaps) || isInTimeRange(slotStartTime, startTime, endTime) || isInTimeRange(slotEndTime, startTime, endTime);\n },\n _isInDateSlot: function (event) {\n var groups = this.groups[0];\n var slotStart = groups.firstSlot().start;\n var slotEnd = groups.lastSlot().end - 1;\n var startTime = kendo.date.toUtcTime(event.start);\n var endTime = kendo.date.toUtcTime(event.end);\n return (isInDateRange(startTime, slotStart, slotEnd) || isInDateRange(endTime, slotStart, slotEnd) || isInDateRange(slotStart, startTime, endTime) || isInDateRange(slotEnd, startTime, endTime)) && (!isInDateRange(endTime, slotStart, slotStart) || isInDateRange(endTime, startTime, startTime) || event.isAllDay);\n },\n _updateAllDayHeaderHeight: function (height) {\n if (this._height !== height) {\n this._height = height;\n var allDaySlots = this.element.find('.k-scheduler-header-all-day td');\n if (allDaySlots.length) {\n allDaySlots.parent().add(this.element.find('.k-scheduler-times-all-day').parent()).height(height);\n for (var groupIndex = 0; groupIndex < this.groups.length; groupIndex++) {\n this.groups[groupIndex].refresh();\n }\n }\n }\n },\n _renderEvents: function (events, groupIndex) {\n var allDayEventContainer = this.datesHeader.find('.k-scheduler-header-wrap > div');\n var byDate = this._isGroupedByDate();\n var event;\n var idx;\n var length;\n for (idx = 0, length = events.length; idx < length; idx++) {\n event = events[idx];\n if (this._isInDateSlot(event)) {\n var isMultiDayEvent = event.isAllDay || event.end.getTime() - event.start.getTime() >= MS_PER_DAY;\n var container = isMultiDayEvent && !this._isVerticallyGrouped() ? allDayEventContainer : this.content;\n var element, ranges, range, start, end, group;\n if (!isMultiDayEvent) {\n if (this._isInTimeSlot(event)) {\n group = this.groups[groupIndex];\n if (!group._continuousEvents) {\n group._continuousEvents = [];\n }\n ranges = group.slotRanges(event);\n var rangeCount = ranges.length;\n for (var rangeIndex = 0; rangeIndex < rangeCount; rangeIndex++) {\n range = ranges[rangeIndex];\n start = event.start;\n end = event.end;\n if (rangeCount > 1) {\n if (rangeIndex === 0) {\n end = range.end.endDate();\n } else if (rangeIndex == rangeCount - 1) {\n start = range.start.startDate();\n } else {\n start = range.start.startDate();\n end = range.end.endDate();\n }\n }\n var occurrence = event.clone({\n start: start,\n end: end,\n _startTime: event._startTime,\n _endTime: event.endTime\n });\n if (this._isInTimeSlot(occurrence)) {\n var head = range.head;\n element = this._createEventElement(event, !isMultiDayEvent, head, range.tail);\n element.appendTo(container);\n this._positionEvent(occurrence, element, range);\n addContinuousEvent(group, range, element, false);\n }\n }\n }\n } else if (this.options.allDaySlot) {\n group = this.groups[groupIndex];\n if (!group._continuousEvents) {\n group._continuousEvents = [];\n }\n ranges = group.slotRanges(event);\n if (ranges.length) {\n range = ranges[0];\n var startIndex = range.start.index;\n var endIndex = range.end.index;\n if (byDate && startIndex !== endIndex) {\n start = range.start.start;\n end = range.end.end;\n var newStart = new Date(start);\n var newEnd = new Date(start);\n for (var i = range.start.index; i <= range.end.index; i++) {\n element = this._createEventElement(event, !isMultiDayEvent, i !== endIndex, i !== startIndex);\n var dateRange = group.daySlotRanges(newStart, newEnd, true)[0];\n newEnd.setDate(newEnd.getDate() + 1);\n newStart.setDate(newStart.getDate() + 1);\n this._positionAllDayEvent(element, dateRange);\n addContinuousEvent(group, dateRange, element, true);\n element.appendTo(container);\n }\n } else {\n element = this._createEventElement(event, !isMultiDayEvent);\n this._positionAllDayEvent(element, ranges[0]);\n addContinuousEvent(group, ranges[0], element, true);\n element.appendTo(container);\n }\n }\n }\n }\n }\n },\n render: function (events) {\n this._headerColumnCount = 0;\n this._groups();\n this.element.find('.k-event').remove();\n events = new kendo.data.Query(events).sort([\n {\n field: 'start',\n dir: 'asc'\n },\n {\n field: 'end',\n dir: 'desc'\n }\n ]).toArray();\n var eventsByResource = [];\n this._eventsByResource(events, this.groupedResources, eventsByResource);\n var eventsPerDate = $.map(this._dates, function (date) {\n return Math.max.apply(null, $.map(eventsByResource, function (events) {\n return $.grep(events, function (event) {\n return event.isMultiDay() && isInDateRange(date, getDate(event.start), getDate(event.end));\n }).length;\n }));\n });\n var height = Math.max.apply(null, eventsPerDate);\n this._updateAllDayHeaderHeight((height + 1) * this._allDayHeaderHeight);\n for (var groupIndex = 0; groupIndex < eventsByResource.length; groupIndex++) {\n this._renderEvents(eventsByResource[groupIndex], groupIndex);\n }\n this.refreshLayout();\n this._currentTime(false);\n this.trigger('activate');\n },\n _eventsByResource: function (events, resources, result) {\n var resource = resources[0];\n if (resource) {\n var view = resource.dataSource.view();\n for (var itemIdx = 0; itemIdx < view.length; itemIdx++) {\n var value = this._resourceValue(resource, view[itemIdx]);\n var eventsFilteredByResource = new kendo.data.Query(events).filter({\n field: resource.field,\n operator: SchedulerView.groupEqFilter(value)\n }).toArray();\n if (resources.length > 1) {\n this._eventsByResource(eventsFilteredByResource, resources.slice(1), result);\n } else {\n result.push(eventsFilteredByResource);\n }\n }\n } else {\n result.push(events);\n }\n },\n _columnOffsetForResource: function (index) {\n return this._columnCountForLevel(index) / this._columnCountForLevel(index - 1);\n },\n _columnCountForLevel: function (level) {\n var columnLevel = this.columnLevels[level];\n return columnLevel ? columnLevel.length : 0;\n },\n _rowCountForLevel: function (level) {\n var rowLevel = this.rowLevels[level];\n return rowLevel ? rowLevel.length : 0;\n },\n clearSelection: function () {\n this.content.add(this.datesHeader).find('.k-state-selected').removeAttr('id').attr('aria-selected', false).removeClass('k-state-selected');\n },\n _updateDirection: function (selection, ranges, multiple, reverse, vertical) {\n var isDaySlot = selection.isAllDay;\n var startSlot = ranges[0].start;\n var endSlot = ranges[ranges.length - 1].end;\n if (multiple) {\n if (vertical) {\n if (!isDaySlot && startSlot.index === endSlot.index && startSlot.collectionIndex === endSlot.collectionIndex) {\n selection.backward = reverse;\n }\n } else {\n if (isDaySlot && startSlot.index === endSlot.index || !isDaySlot && startSlot.collectionIndex === endSlot.collectionIndex) {\n selection.backward = reverse;\n }\n }\n }\n },\n _changeViewPeriod: function (selection, reverse, vertical) {\n if (!vertical) {\n var date = reverse ? this.previousDate() : this.nextDate();\n var start = selection.start;\n var end = selection.end;\n var verticalByDate = this._isGroupedByDate() && this._isVerticallyGrouped();\n var group = this.groups[selection.groupIndex];\n var collection = reverse ? group._timeSlotCollections : group._getCollections(group.daySlotCollectionCount());\n var slots = collection[collection.length - 1]._slots;\n var slotIndex = !reverse && !group.daySlotCollectionCount() ? 0 : slots.length - 1;\n var endMilliseconds;\n selection.start = new Date(date);\n selection.end = new Date(date);\n if (verticalByDate) {\n var newStart = new Date(slots[slotIndex].startDate());\n var newEnd = new Date(slots[slotIndex].endDate());\n endMilliseconds = getMilliseconds(newEnd) ? getMilliseconds(newEnd) : MS_PER_DAY;\n setTime(selection.start, getMilliseconds(newStart));\n setTime(selection.end, endMilliseconds);\n if (group.daySlotCollectionCount()) {\n selection.isAllDay = !selection.isAllDay;\n }\n } else {\n endMilliseconds = selection.isAllDay || !getMilliseconds(end) ? MS_PER_DAY : getMilliseconds(end);\n setTime(selection.start, getMilliseconds(start));\n setTime(selection.end, endMilliseconds);\n }\n if (!this._isVerticallyGrouped()) {\n selection.groupIndex = reverse ? this.groups.length - 1 : 0;\n }\n selection.events = [];\n return true;\n }\n }\n });\n extend(true, ui, {\n MultiDayView: MultiDayView,\n DayView: MultiDayView.extend({\n options: {\n name: 'DayView',\n title: 'Day'\n },\n name: 'day'\n }),\n WeekView: MultiDayView.extend({\n options: {\n name: 'WeekView',\n title: 'Week',\n selectedDateFormat: '{0:D} - {1:D}',\n selectedShortDateFormat: '{0:d} - {1:d}'\n },\n name: 'week',\n calculateDateRange: function () {\n var selectedDate = this.options.date, start = kendo.date.dayOfWeek(selectedDate, this.calendarInfo().firstDay, -1), idx, length, dates = [];\n for (idx = 0, length = 7; idx < length; idx++) {\n dates.push(start);\n start = kendo.date.nextDay(start);\n }\n this._render(dates);\n }\n }),\n WorkWeekView: MultiDayView.extend({\n options: {\n name: 'WorkWeekView',\n title: 'Work Week',\n selectedDateFormat: '{0:D} - {1:D}',\n selectedShortDateFormat: '{0:d} - {1:d}'\n },\n name: 'workWeek',\n nextDate: function () {\n var weekStart = kendo.date.dayOfWeek(kendo.date.nextDay(this.startDate()), this.calendarInfo().firstDay, 1);\n return kendo.date.addDays(weekStart, this._workDays[0]);\n },\n previousDate: function () {\n var weekStart = kendo.date.dayOfWeek(this.startDate(), this.calendarInfo().firstDay, -1);\n var workDays = this._workDays;\n return kendo.date.addDays(weekStart, workDays[workDays.length - 1] - 7);\n },\n calculateDateRange: function () {\n var selectedDate = this.options.date, dayOfWeek = kendo.date.dayOfWeek, weekStart = dayOfWeek(selectedDate, this.calendarInfo().firstDay, -1), start = dayOfWeek(weekStart, this.options.workWeekStart, 1), end = dayOfWeek(start, this.options.workWeekEnd, 1), dates = [];\n while (start <= end) {\n dates.push(start);\n start = kendo.date.nextDay(start);\n }\n this._render(dates);\n }\n })\n });\n }(window.kendo.jQuery));\n return window.kendo;\n}, typeof define == 'function' && define.amd ? define : function (a1, a2, a3) {\n (a3 || a2)();\n}));"],"sourceRoot":"/source/"}