text: angular.module("ui.rCalendar.tpls",["templates/rcalendar/calendar.html","templates/rcalendar/day.html","templates/rcalendar/month.html","templates/rcalendar/week.html"]),angular.module("ui.rCalendar",["ui.rCalendar.tpls"]).constant("calendarConfig",{formatDay:"dd",formatDayHeader:"EEE",formatDayTitle:"MMMM dd, yyyy",formatWeekTitle:"MMMM yyyy, Week w",formatMonthTitle:"MMMM yyyy",calendarMode:"month",showEventDetail:!0,startingDayMonth:0,startingDayWeek:0,eventSource:null,queryMode:"local"}).controller("ui.rCalendar.CalendarController",["$scope","$attrs","$parse","$interpolate","$log","dateFilter","calendarConfig","$timeout",function($scope,$attrs,$parse,$interpolate,$log,dateFilter,calendarConfig,$timeout){"use strict";function overlap(event1,event2){return!(event1.endIndex<=event2.startIndex||event2.endIndex<=event1.startIndex)}function calculatePosition(events){var i,j,col,len=events.length,maxColumn=0,isForbidden=new Array(len);for(i=0;len>i;i+=1){for(col=0;maxColumn>col;col+=1)isForbidden[col]=!1;for(j=0;i>j;j+=1)overlap(events[i],events[j])&&(isForbidden[events[j].position]=!0);for(col=0;maxColumn>col&&isForbidden[col];col+=1);maxColumn>col?events[i].position=col:events[i].position=maxColumn++}}function calculateWidth(orderedEvents){var event,index,i,j,len,eventCountInCell,currentEventInCell,cells=new Array(24);for(orderedEvents.sort(function(eventA,eventB){return eventB.position-eventA.position}),i=0;24>i;i+=1)cells[i]={calculated:!1,events:[]};for(len=orderedEvents.length,i=0;len>i;i+=1)for(event=orderedEvents[i],index=event.startIndex;index<event.endIndex;)cells[index].events.push(event),index+=1;for(i=0;len>i;){if(event=orderedEvents[i],!event.overlapNumber){var overlapNumber=event.position+1;event.overlapNumber=overlapNumber;for(var eventQueue=[event];event=eventQueue.shift();)for(index=event.startIndex;index<event.endIndex;){if(!cells[index].calculated&&(cells[index].calculated=!0,cells[index].events))for(eventCountInCell=cells[index].events.length,j=0;eventCountInCell>j;j+=1)currentEventInCell=cells[index].events[j],currentEventInCell.overlapNumber||(currentEventInCell.overlapNumber=overlapNumber,eventQueue.push(currentEventInCell));index+=1}}i+=1}}function getAdjacentCalendarDate(currentCalendarDate,direction){var firstDayInNextMonth,step=self.mode.step,calculateCalendarDate=new Date(currentCalendarDate),year=calculateCalendarDate.getFullYear()+direction*(step.years||0),month=calculateCalendarDate.getMonth()+direction*(step.months||0),date=calculateCalendarDate.getDate()+direction*(step.days||0);return calculateCalendarDate.setFullYear(year,month,date),"month"===$scope.calendarMode&&(firstDayInNextMonth=new Date(year,month+1,1),firstDayInNextMonth.getTime()<=calculateCalendarDate.getTime()&&(calculateCalendarDate=new Date(firstDayInNextMonth-864e5))),calculateCalendarDate}var self=this,ngModelCtrl={$setViewValue:angular.noop};angular.forEach(["formatDay","formatDayHeader","formatDayTitle","formatWeekTitle","formatMonthTitle","showEventDetail","startingDayMonth","startingDayWeek","eventSource","queryMode"],function(key,index){self[key]=angular.isDefined($attrs[key])?5>index?$interpolate($attrs[key])($scope.$parent):$scope.$parent.$eval($attrs[key]):calendarConfig[key]}),$scope.$parent.$watch($attrs.eventSource,function(value){self.onEventSourceChanged(value)}),$scope.calendarMode=$scope.calendarMode||calendarConfig.calendarMode,angular.isDefined($attrs.initDate)&&(self.currentCalendarDate=$scope.$parent.$eval($attrs.initDate)),self.currentCalendarDate||(self.currentCalendarDate=new Date,$attrs.ngModel&&!$scope.$parent.$eval($attrs.ngModel)&&$parse($attrs.ngModel).assign($scope.$parent,self.currentCalendarDate)),self.init=function(ngModelCtrl_){ngModelCtrl=ngModelCtrl_,ngModelCtrl.$render=function(){self.render()}},self.render=function(){if(ngModelCtrl.$modelValue){var date=new Date(ngModelCtrl.$modelValue),isValid=!isNaN(date);isValid?this.currentCalendarDate=date:$log.error('"ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.'),ngModelCtrl.$setValidity("date",isValid)}this.refreshView()},self.refreshView=function(){this.mode&&(this.range=this._getRange(this.currentCalendarDate),$scope.titleChanged&&$scope.titleChanged({title:self._getTitle()}),this._refreshView(),this.rangeChanged())},self.split=function(arr,size){for(var arrays=[];arr.length>0;)arrays.push(arr.splice(0,size));return arrays},self.onEventSourceChanged=function(value){self.eventSource=value,self._onDataLoaded&&self._onDataLoaded()},self.getAdjacentViewStartTime=function(direction){var adjacentCalendarDate=getAdjacentCalendarDate(self.currentCalendarDate,direction);return self._getRange(adjacentCalendarDate).startTime},self.move=function(direction){self.direction=direction,self.moveOnSelected?self.moveOnSelected=!1:self.currentCalendarDate=getAdjacentCalendarDate(self.currentCalendarDate,direction),ngModelCtrl.$setViewValue(self.currentCalendarDate),self.refreshView(),self.direction=0},self.rangeChanged=function(){"local"===self.queryMode?self.eventSource&&self._onDataLoaded&&self._onDataLoaded():"remote"===self.queryMode&&$scope.rangeChanged&&$scope.rangeChanged({startTime:this.range.startTime,endTime:this.range.endTime})},self.registerSlideChanged=function(scope){scope.currentViewIndex=0,scope.slideChanged=function($index){$timeout(function(){var currentViewIndex=scope.currentViewIndex,direction=0;$index-currentViewIndex===1||0===$index&&2===currentViewIndex?direction=1:(currentViewIndex-$index===1||2===$index&&0===currentViewIndex)&&(direction=-1),currentViewIndex=$index,scope.currentViewIndex=currentViewIndex,self.move(direction),scope.$digest()},200)}},self.populateAdjacentViews=function(scope){var currentViewStartDate,currentViewData,toUpdateViewIndex,currentViewIndex=scope.currentViewIndex,getViewData=this._getViewData;1===self.direction?(currentViewStartDate=self.getAdjacentViewStartTime(1),toUpdateViewIndex=(currentViewIndex+1)%3,angular.copy(getViewData(currentViewStartDate),scope.views[toUpdateViewIndex])):-1===self.direction?(currentViewStartDate=self.getAdjacentViewStartTime(-1),toUpdateViewIndex=(currentViewIndex+2)%3,angular.copy(getViewData(currentViewStartDate),scope.views[toUpdateViewIndex])):(currentViewData=[],currentViewStartDate=self.range.startTime,currentViewData.push(getViewData(currentViewStartDate)),currentViewStartDate=self.getAdjacentViewStartTime(1),currentViewData.push(getViewData(currentViewStartDate)),currentViewStartDate=self.getAdjacentViewStartTime(-1),currentViewData.push(getViewData(currentViewStartDate)),scope.views=currentViewData)},self.placeEvents=function(orderedEvents){calculatePosition(orderedEvents),calculateWidth(orderedEvents)},self.placeAllDayEvents=function(orderedEvents){calculatePosition(orderedEvents)}}]).directive("calendar",function(){"use strict";return{restrict:"EA",replace:!0,templateUrl:"templates/rcalendar/calendar.html",scope:{calendarMode:"=",rangeChanged:"&",eventSelected:"&",timeSelected:"&",titleChanged:"&"},require:["calendar","?^ngModel"],controller:"ui.rCalendar.CalendarController",link:function(scope,element,attrs,ctrls){var calendarCtrl=ctrls[0],ngModelCtrl=ctrls[1];ngModelCtrl&&calendarCtrl.init(ngModelCtrl),scope.$on("eventSourceChanged",function(event,value){calendarCtrl.onEventSourceChanged(value)})}}}).directive("monthview",["dateFilter","$ionicSlideBoxDelegate",function(dateFilter,$ionicSlideBoxDelegate){"use strict";return{restrict:"EA",replace:!0,templateUrl:"templates/rcalendar/month.html",require:["^calendar","?^ngModel"],link:function(scope,element,attrs,ctrls){function getDates(startDate,n){var dates=new Array(n),current=new Date(startDate),i=0;for(current.setHours(12);n>i;)dates[i++]=new Date(current),current.setDate(current.getDate()+1);return dates}function createDateObject(date,format){return{date:date,label:dateFilter(date,format)}}function updateCurrentView(currentViewStartDate,view){var r,currentCalendarDate=ctrl.currentCalendarDate,today=new Date,oneDay=864e5,selectedDayDifference=Math.floor((currentCalendarDate.getTime()-currentViewStartDate.getTime())/oneDay),currentDayDifference=Math.floor((today.getTime()-currentViewStartDate.getTime())/oneDay);for(r=0;42>r;r+=1)view.dates[r].selected=!1;selectedDayDifference>=0&&42>selectedDayDifference?(view.dates[selectedDayDifference].selected=!0,scope.selectedDate=view.dates[selectedDayDifference]):scope.selectedDate={events:[]},currentDayDifference>=0&&42>currentDayDifference&&(view.dates[currentDayDifference].current=!0)}function compareEvent(event1,event2){return event1.allDay?1:event2.allDay?-1:event1.startTime.getTime()-event2.startTime.getTime()}var ctrl=ctrls[0],ngModelCtrl=ctrls[1];scope.showEventDetail=ctrl.showEventDetail,ctrl.mode={step:{months:1}},scope.select=function(selectedDate){var dates,r,views=scope.views;if(views){dates=views[scope.currentViewIndex].dates;var currentCalendarDate=ctrl.currentCalendarDate,currentMonth=currentCalendarDate.getMonth(),currentYear=currentCalendarDate.getFullYear(),selectedMonth=selectedDate.getMonth(),selectedYear=selectedDate.getFullYear(),direction=0;if(currentYear===selectedYear?currentMonth!==selectedMonth&&(direction=selectedMonth>currentMonth?1:-1):direction=selectedYear>currentYear?1:-1,ctrl.currentCalendarDate=selectedDate,0===direction){ctrl.currentCalendarDate=selectedDate,ngModelCtrl&&ngModelCtrl.$setViewValue(selectedDate);var currentViewStartDate=ctrl.range.startTime,oneDay=864e5,selectedDayDifference=Math.floor((selectedDate.getTime()-currentViewStartDate.getTime())/oneDay);for(r=0;42>r;r+=1)dates[r].selected=!1;selectedDayDifference>=0&&42>selectedDayDifference&&(dates[selectedDayDifference].selected=!0,scope.selectedDate=dates[selectedDayDifference])}else ctrl.moveOnSelected=!0,1===direction?$ionicSlideBoxDelegate.next():$ionicSlideBoxDelegate.previous();scope.timeSelected&&scope.timeSelected({selectedTime:selectedDate})}},scope.getHighlightClass=function(date){var className="";return date.selected?className="monthview-selected":date.current?className="monthview-current":date.hasEvent&&(className=date.secondary?"monthview-secondary-with-event":"monthview-primary-with-event"),date.secondary&&(className?className+=" text-muted":className="text-muted"),className},ctrl._getTitle=function(){var currentViewStartDate=ctrl.range.startTime,date=currentViewStartDate.getDate(),month=(currentViewStartDate.getMonth()+(1!==date?1:0))%12,year=currentViewStartDate.getFullYear()+(1!==date&&0===month?1:0),headerDate=new Date(year,month,1);return dateFilter(headerDate,ctrl.formatMonthTitle)},ctrl._getViewData=function(startTime){for(var startDate=startTime,date=startDate.getDate(),month=(startDate.getMonth()+(1!==date?1:0))%12,days=getDates(startDate,42),i=0;42>i;i++)days[i]=angular.extend(createDateObject(days[i],ctrl.formatDay),{secondary:days[i].getMonth()!==month});return{dates:days}},ctrl._refreshView=function(){ctrl.populateAdjacentViews(scope),updateCurrentView(ctrl.range.startTime,scope.views[scope.currentViewIndex])},ctrl._onDataLoaded=function(){for(var eventSource=ctrl.eventSource,len=eventSource?eventSource.length:0,startTime=ctrl.range.startTime,endTime=ctrl.range.endTime,timeZoneOffset=-(new Date).getTimezoneOffset(),utcStartTime=new Date(startTime.getTime()+60*timeZoneOffset*1e3),utcEndTime=new Date(endTime.getTime()+60*timeZoneOffset*1e3),currentViewIndex=scope.currentViewIndex,dates=scope.views[currentViewIndex].dates,oneDay=864e5,eps=.001,r=0;42>r;r+=1)dates[r].hasEvent&&(dates[r].hasEvent=!1,dates[r].events=[]);for(var i=0;len>i;i+=1){var st,et,event=eventSource[i],eventStartTime=new Date(event.startTime),eventEndTime=new Date(event.endTime);if(event.allDay){if(utcStartTime>=eventEndTime||eventStartTime>=utcEndTime)continue;st=utcStartTime,et=utcEndTime}else{if(startTime>=eventEndTime||eventStartTime>=endTime)continue;st=startTime,et=endTime}var timeDifferenceStart;timeDifferenceStart=st>=eventStartTime?0:(eventStartTime-st)/oneDay;var timeDifferenceEnd;timeDifferenceEnd=eventEndTime>=et?(et-st)/oneDay:(eventEndTime-st)/oneDay;for(var eventSet,index=Math.floor(timeDifferenceStart);timeDifferenceEnd-eps>index;)dates[index].hasEvent=!0,eventSet=dates[index].events,eventSet?eventSet.push(event):(eventSet=[],eventSet.push(event),dates[index].events=eventSet),index+=1}for(r=0;42>r;r+=1)dates[r].hasEvent&&dates[r].events.sort(compareEvent);var findSelected=!1;for(r=0;42>r;r+=1){if(dates[r].selected){scope.selectedDate=dates[r],findSelected=!0;break}if(findSelected)break}},ctrl._getRange=function(currentDate){var endDate,year=currentDate.getFullYear(),month=currentDate.getMonth(),firstDayOfMonth=new Date(year,month,1),difference=ctrl.startingDayMonth-firstDayOfMonth.getDay(),numDisplayedFromPreviousMonth=difference>0?7-difference:-difference,startDate=new Date(firstDayOfMonth);return numDisplayedFromPreviousMonth>0&&startDate.setDate(-numDisplayedFromPreviousMonth+1),endDate=new Date(startDate),endDate.setDate(endDate.getDate()+42),{startTime:startDate,endTime:endDate}},ctrl.registerSlideChanged(scope),ctrl.refreshView()}}}]).directive("weekview",["dateFilter",function(dateFilter){"use strict";return{restrict:"EA",replace:!0,templateUrl:"templates/rcalendar/week.html",require:"^calendar",link:function(scope,element,attrs,ctrl){function getDates(startTime,n){var dates=new Array(n),current=new Date(startTime),i=0;for(current.setHours(12);n>i;)dates[i++]={date:new Date(current)},current.setDate(current.getDate()+1);return dates}function createDateObjects(startTime){for(var row,times=[],time=new Date(startTime.getTime()),currentHour=time.getHours(),currentDate=time.getDate(),hour=0;24>hour;hour+=1){row=[];for(var day=0;7>day;day+=1)time.setHours(currentHour+hour),time.setDate(currentDate+day),row.push({time:new Date(time.getTime())});times.push(row)}return times}function getISO8601WeekNumber(date){var checkDate=new Date(date);checkDate.setDate(checkDate.getDate()+4-(checkDate.getDay()||7));var time=checkDate.getTime();return checkDate.setMonth(0),checkDate.setDate(1),Math.floor(Math.round((time-checkDate)/864e5)/7)+1}ctrl.mode={step:{days:7}},ctrl._getTitle=function(){var weekNumberIndex,title,firstDayOfWeek=ctrl.range.startTime,weekFormatPattern="w";return weekNumberIndex=ctrl.formatWeekTitle.indexOf(weekFormatPattern),title=dateFilter(firstDayOfWeek,ctrl.formatWeekTitle),-1!==weekNumberIndex&&(title=title.replace(weekFormatPattern,getISO8601WeekNumber(firstDayOfWeek))),title},scope.select=function(selectedTime){scope.timeSelected&&scope.timeSelected({selectedTime:selectedTime})},ctrl._getViewData=function(startTime){return{rows:createDateObjects(startTime),dates:getDates(startTime,7)}},ctrl._refreshView=function(){ctrl.populateAdjacentViews(scope)},ctrl._onDataLoaded=function(){var i,day,hour,eventSet,eventSource=ctrl.eventSource,len=eventSource?eventSource.length:0,startTime=ctrl.range.startTime,endTime=ctrl.range.endTime,timeZoneOffset=-(new Date).getTimezoneOffset(),utcStartTime=new Date(startTime.getTime()+6e4*timeZoneOffset),utcEndTime=new Date(endTime.getTime()+6e4*timeZoneOffset),currentViewIndex=scope.currentViewIndex,rows=scope.views[currentViewIndex].rows,dates=scope.views[currentViewIndex].dates,oneHour=36e5,oneDay=864e5,eps=.016,allDayEventInRange=!1,normalEventInRange=!1;for(i=0;7>i;i+=1)dates[i].events=[];for(day=0;7>day;day+=1)for(hour=0;24>hour;hour+=1)rows[hour][day].events=[];for(i=0;len>i;i+=1){var event=eventSource[i],eventStartTime=new Date(event.startTime),eventEndTime=new Date(event.endTime);if(event.allDay){if(utcStartTime>=eventEndTime||eventStartTime>=utcEndTime)continue;allDayEventInRange=!0;var allDayStartIndex;allDayStartIndex=utcStartTime>=eventStartTime?0:Math.floor((eventStartTime-utcStartTime)/oneDay);var allDayEndIndex;allDayEndIndex=eventEndTime>=utcEndTime?Math.ceil((utcEndTime-utcStartTime)/oneDay):Math.ceil((eventEndTime-utcStartTime)/oneDay);var displayAllDayEvent={event:event,startIndex:allDayStartIndex,endIndex:allDayEndIndex};eventSet=dates[allDayStartIndex].events,eventSet?eventSet.push(displayAllDayEvent):(eventSet=[],eventSet.push(displayAllDayEvent),dates[allDayStartIndex].events=eventSet)}else{if(startTime>=eventEndTime||eventStartTime>=endTime)continue;normalEventInRange=!0;var timeDifferenceStart;timeDifferenceStart=startTime>=eventStartTime?0:(eventStartTime-startTime)/oneHour;var timeDifferenceEnd;timeDifferenceEnd=eventEndTime>=endTime?(endTime-startTime)/oneHour:(eventEndTime-startTime)/oneHour;var endRowIndex,startIndex=Math.floor(timeDifferenceStart),endIndex=Math.ceil(timeDifferenceEnd-eps),startRowIndex=startIndex%24,dayIndex=Math.floor(startIndex/24),endOfDay=24*dayIndex;do{endOfDay+=24,endRowIndex=endIndex>=endOfDay?24:endIndex%24;var displayEvent={event:event,startIndex:startRowIndex,endIndex:endRowIndex};eventSet=rows[startRowIndex][dayIndex].events,eventSet?eventSet.push(displayEvent):(eventSet=[],eventSet.push(displayEvent),rows[startRowIndex][dayIndex].events=eventSet),startRowIndex=0,dayIndex+=1}while(endIndex>endOfDay)}}if(normalEventInRange)for(day=0;7>day;day+=1){var orderedEvents=[];for(hour=0;24>hour;hour+=1)rows[hour][day].events&&(orderedEvents=orderedEvents.concat(rows[hour][day].events));orderedEvents.length>0&&ctrl.placeEvents(orderedEvents)}if(allDayEventInRange){var orderedAllDayEvents=[];for(day=0;7>day;day+=1)dates[day].events&&(orderedAllDayEvents=orderedAllDayEvents.concat(dates[day].events));orderedAllDayEvents.length>0&&ctrl.placeAllDayEvents(orderedAllDayEvents)}},ctrl._getRange=function(currentDate){var year=currentDate.getFullYear(),month=currentDate.getMonth(),date=currentDate.getDate(),day=currentDate.getDay(),firstDayOfWeek=new Date(year,month,date-day+ctrl.startingDayWeek),endTime=new Date(year,month,date-day+7);return{startTime:firstDayOfWeek,endTime:endTime}},ctrl.registerSlideChanged(scope),ctrl.refreshView()}}}]).directive("dayview",["dateFilter",function(dateFilter){"use strict";return{restrict:"EA",replace:!0,templateUrl:"templates/rcalendar/day.html",require:"^calendar",link:function(scope,element,attrs,ctrl){function createDateObjects(startTime){for(var rows=[],time=new Date(startTime.getTime()),currentHour=time.getHours(),currentDate=time.getDate(),hour=0;24>hour;hour+=1)time.setHours(currentHour+hour),time.setDate(currentDate),rows.push({time:new Date(time.getTime())});return rows}ctrl.mode={step:{days:1}},scope.select=function(selectedTime){scope.timeSelected&&scope.timeSelected({selectedTime:selectedTime})},ctrl._onDataLoaded=function(){var hour,eventSet,eventSource=ctrl.eventSource,len=eventSource?eventSource.length:0,startTime=ctrl.range.startTime,endTime=ctrl.range.endTime,timeZoneOffset=-(new Date).getTimezoneOffset(),utcStartTime=new Date(startTime.getTime()+60*timeZoneOffset*1e3),utcEndTime=new Date(endTime.getTime()+60*timeZoneOffset*1e3),currentViewIndex=scope.currentViewIndex,rows=scope.views[currentViewIndex].rows,allDayEvents=scope.views[currentViewIndex].allDayEvents=[],oneHour=36e5,eps=.016,normalEventInRange=!1;for(hour=0;24>hour;hour+=1)rows[hour].events=[];for(var i=0;len>i;i+=1){var event=eventSource[i],eventStartTime=new Date(event.startTime),eventEndTime=new Date(event.endTime);if(event.allDay){if(utcStartTime>=eventEndTime||eventStartTime>=utcEndTime)continue;allDayEvents.push({event:event})}else{if(startTime>=eventEndTime||eventStartTime>=endTime)continue;normalEventInRange=!0;var timeDifferenceStart;timeDifferenceStart=startTime>=eventStartTime?0:(eventStartTime-startTime)/oneHour;var timeDifferenceEnd;timeDifferenceEnd=eventEndTime>=endTime?(endTime-startTime)/oneHour:(eventEndTime-startTime)/oneHour;var startIndex=Math.floor(timeDifferenceStart),endIndex=Math.ceil(timeDifferenceEnd-eps),displayEvent={event:event,startIndex:startIndex,endIndex:endIndex};eventSet=rows[startIndex].events,eventSet?eventSet.push(displayEvent):(eventSet=[],eventSet.push(displayEvent),rows[startIndex].events=eventSet)}}if(normalEventInRange){var orderedEvents=[];for(hour=0;24>hour;hour+=1)rows[hour].events&&(orderedEvents=orderedEvents.concat(rows[hour].events));orderedEvents.length>0&&ctrl.placeEvents(orderedEvents)}},ctrl._refreshView=function(){ctrl.populateAdjacentViews(scope)},ctrl._getTitle=function(){var startingDate=ctrl.range.startTime;return dateFilter(startingDate,ctrl.formatDayTitle)},ctrl._getViewData=function(startTime){return{rows:createDateObjects(startTime),allDayEvents:[]}},ctrl._getRange=function(currentDate){var year=currentDate.getFullYear(),month=currentDate.getMonth(),date=currentDate.getDate(),startTime=new Date(year,month,date),endTime=new Date(year,month,date+1);return{startTime:startTime,endTime:endTime}},ctrl.registerSlideChanged(scope),ctrl.refreshView()}}}]),angular.module("templates/rcalendar/calendar.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("templates/rcalendar/calendar.html",'<div class="calendar-container" ng-switch="calendarMode">\n    <dayview ng-switch-when="day"></dayview>\n    <monthview ng-switch-when="month"></monthview>\n    <weekview ng-switch-when="week"></weekview>\n</div>')}]),angular.module("templates/rcalendar/day.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("templates/rcalendar/day.html",'<div class="dayview">\n    <ion-slide-box class="dayview-slide" on-slide-changed="slideChanged($index)" does-continue="true"\n                   show-pager="false">\n        <ion-slide ng-repeat="view in views track by $index">\n            <div class="dayview-allday-table">\n                <div class="dayview-allday-label">\n                    all day\n                </div>\n                <ion-scroll zooming="true" direction="y" class="dayview-allday-content-wrapper" has-bouncing="false">\n                    <table class="table table-bordered weekview-allday-content-table">\n                        <tbody>\n                        <tr>\n                            <td class="calendar-cell" ng-class="{\'calendar-event-wrap\':allDayEvents}"\n                                ng-if="$index===currentViewIndex">\n                                <div ng-repeat="displayEvent in view.allDayEvents" class="calendar-event"\n                                     ng-click="eventSelected({event:displayEvent.event})"\n                                     ng-style="{top: 25*$index+\'px\',width: \'100%\',height:\'25px\'}">\n                                    <div class="calendar-event-inner">{{displayEvent.event.title}}</div>\n                                </div>\n                            </td>\n                            <td class="calendar-cell" ng-if="$index!==currentViewIndex">\n                            </td>\n                        </tr>\n                        </tbody>\n                    </table>\n                </ion-scroll>\n            </div>\n            <ion-content class="dayview-normal-event-container" has-bouncing="false">\n                <table class="table table-bordered table-fixed dayview-normal-event-table" ng-if="$index===currentViewIndex">\n                    <tbody>\n                    <tr ng-repeat="tm in view.rows track by $index">\n                        <td class="calendar-hour-column text-center">\n                            {{$index<12?($index === 0?12:$index)+\'am\':($index === 12?$index:$index-12)+\'pm\'}}\n                        </td>\n                        <td class="calendar-cell" ng-click="select(tm.time)">\n                            <div ng-class="{\'calendar-event-wrap\': tm.events}" ng-if="tm.events">\n                                <div ng-repeat="displayEvent in tm.events" class="calendar-event"\n                                     ng-click="eventSelected({event:displayEvent.event})"\n                                     ng-style="{left: 100/displayEvent.overlapNumber*displayEvent.position+\'%\', width: 100/displayEvent.overlapNumber+\'%\', height: 37*(displayEvent.endIndex-displayEvent.startIndex)+\'px\'}">\n                                    <div class="calendar-event-inner">{{displayEvent.event.title}}</div>\n                                </div>\n                            </div>\n                        </td>\n                    </tr>\n                    </tbody>\n                </table>\n                <table class="table table-bordered table-fixed dayview-normal-event-table" ng-if="$index!==currentViewIndex">\n                    <tbody>\n                    <tr ng-repeat="tm in view.rows track by $index">\n                        <td class="calendar-hour-column text-center">\n                            {{$index<12?($index === 0?12:$index)+\'am\':($index === 12?$index:$index-12)+\'pm\'}}\n                        </td>\n                        <td class="calendar-cell">\n                        </td>\n                    </tr>\n                    </tbody>\n                </table>\n            </ion-content>\n        </ion-slide>\n    </ion-slide-box>\n</div>')}]),angular.module("templates/rcalendar/month.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("templates/rcalendar/month.html",'<div>\n    <ion-slide-box class="monthview-slide" on-slide-changed="slideChanged($index)" does-continue="true"\n                   show-pager="false">\n        <ion-slide ng-repeat="view in views track by $index">\n            <table ng-if="$index===currentViewIndex" class="table table-bordered monthview-datetable">\n                <thead>\n                <tr>\n                    <th>\n                        <small>Sun</small>\n                    </th>\n                    <th>\n                        <small>Mon</small>\n                    </th>\n                    <th>\n                        <small>Tue</small>\n                    </th>\n                    <th>\n                        <small>Wed</small>\n                    </th>\n                    <th>\n                        <small>Thu</small>\n                    </th>\n                    <th>\n                        <small>Fri</small>\n                    </th>\n                    <th>\n                        <small>Sat</small>\n                    </th>\n                </tr>\n                </thead>\n                <tbody>\n                <tr>\n                    <td ng-click="select(view.dates[0].date)"\n                        ng-class="getHighlightClass(view.dates[0])">{{::view.dates[0].label}}\n                    </td>\n                    <td ng-click="select(view.dates[1].date)"\n                        ng-class="getHighlightClass(view.dates[1])">{{::view.dates[1].label}}\n                    </td>\n                    <td ng-click="select(view.dates[2].date)"\n                        ng-class="getHighlightClass(view.dates[2])">{{::view.dates[2].label}}\n                    </td>\n                    <td ng-click="select(view.dates[3].date)"\n                        ng-class="getHighlightClass(view.dates[3])">{{::view.dates[3].label}}\n                    </td>\n                    <td ng-click="select(view.dates[4].date)"\n                        ng-class="getHighlightClass(view.dates[4])">{{::view.dates[4].label}}\n                    </td>\n                    <td ng-click="select(view.dates[5].date)"\n                        ng-class="getHighlightClass(view.dates[5])">{{::view.dates[5].label}}\n                    </td>\n                    <td ng-click="select(view.dates[6].date)"\n                        ng-class="getHighlightClass(view.dates[6])">{{::view.dates[6].label}}\n                    </td>\n                </tr>\n                <tr>\n                    <td ng-click="select(view.dates[7].date)"\n                        ng-class="getHighlightClass(view.dates[7])">{{::view.dates[7].label}}\n                    </td>\n                    <td ng-click="select(view.dates[8].date)"\n                        ng-class="getHighlightClass(view.dates[8])">{{::view.dates[8].label}}\n                    </td>\n                    <td ng-click="select(view.dates[9].date)"\n                        ng-class="getHighlightClass(view.dates[9])">{{::view.dates[9].label}}\n                    </td>\n                    <td ng-click="select(view.dates[10].date)"\n                        ng-class="getHighlightClass(view.dates[10])">{{::view.dates[10].label}}\n                    </td>\n                    <td ng-click="select(view.dates[11].date)"\n                        ng-class="getHighlightClass(view.dates[11])">{{::view.dates[11].label}}\n                    </td>\n                    <td ng-click="select(view.dates[12].date)"\n                        ng-class="getHighlightClass(view.dates[12])">{{::view.dates[12].label}}\n                    </td>\n                    <td ng-click="select(view.dates[13].date)"\n                        ng-class="getHighlightClass(view.dates[13])">{{::view.dates[13].label}}\n                    </td>\n                </tr>\n                <tr>\n                    <td ng-click="select(view.dates[14].date)"\n                        ng-class="getHighlightClass(view.dates[14])">{{::view.dates[14].label}}\n                    </td>\n                    <td ng-click="select(view.dates[15].date)"\n                        ng-class="getHighlightClass(view.dates[15])">{{::view.dates[15].label}}\n                    </td>\n                    <td ng-click="select(view.dates[16].date)"\n                        ng-class="getHighlightClass(view.dates[16])">{{::view.dates[16].label}}\n                    </td>\n                    <td ng-click="select(view.dates[17].date)"\n                        ng-class="getHighlightClass(view.dates[17])">{{::view.dates[17].label}}\n                    </td>\n                    <td ng-click="select(view.dates[18].date)"\n                        ng-class="getHighlightClass(view.dates[18])">{{::view.dates[18].label}}\n                    </td>\n                    <td ng-click="select(view.dates[19].date)"\n                        ng-class="getHighlightClass(view.dates[19])">{{::view.dates[19].label}}\n                    </td>\n                    <td ng-click="select(view.dates[20].date)"\n                        ng-class="getHighlightClass(view.dates[20])">{{::view.dates[20].label}}\n                    </td>\n                </tr>\n                <tr>\n                    <td ng-click="select(view.dates[21].date)"\n                        ng-class="getHighlightClass(view.dates[21])">{{::view.dates[21].label}}\n                    </td>\n                    <td ng-click="select(view.dates[22].date)"\n                        ng-class="getHighlightClass(view.dates[22])">{{::view.dates[22].label}}\n                    </td>\n                    <td ng-click="select(view.dates[23].date)"\n                        ng-class="getHighlightClass(view.dates[23])">{{::view.dates[23].label}}\n                    </td>\n                    <td ng-click="select(view.dates[24].date)"\n                        ng-class="getHighlightClass(view.dates[24])">{{::view.dates[24].label}}\n                    </td>\n                    <td ng-click="select(view.dates[25].date)"\n                        ng-class="getHighlightClass(view.dates[25])">{{::view.dates[25].label}}\n                    </td>\n                    <td ng-click="select(view.dates[26].date)"\n                        ng-class="getHighlightClass(view.dates[26])">{{::view.dates[26].label}}\n                    </td>\n                    <td ng-click="select(view.dates[27].date)"\n                        ng-class="getHighlightClass(view.dates[27])">{{::view.dates[27].label}}\n                    </td>\n                </tr>\n                <tr>\n                    <td ng-click="select(view.dates[28].date)"\n                        ng-class="getHighlightClass(view.dates[28])">{{::view.dates[28].label}}\n                    </td>\n                    <td ng-click="select(view.dates[29].date)"\n                        ng-class="getHighlightClass(view.dates[29])">{{::view.dates[29].label}}\n                    </td>\n                    <td ng-click="select(view.dates[30].date)"\n                        ng-class="getHighlightClass(view.dates[30])">{{::view.dates[30].label}}\n                    </td>\n                    <td ng-click="select(view.dates[31].date)"\n                        ng-class="getHighlightClass(view.dates[31])">{{::view.dates[31].label}}\n                    </td>\n                    <td ng-click="select(view.dates[32].date)"\n                        ng-class="getHighlightClass(view.dates[32])">{{::view.dates[32].label}}\n                    </td>\n                    <td ng-click="select(view.dates[33].date)"\n                        ng-class="getHighlightClass(view.dates[33])">{{::view.dates[33].label}}\n                    </td>\n                    <td ng-click="select(view.dates[34].date)"\n                        ng-class="getHighlightClass(view.dates[34])">{{::view.dates[34].label}}\n                    </td>\n                </tr>\n                <tr>\n                    <td ng-click="select(view.dates[35].date)"\n                        ng-class="getHighlightClass(view.dates[35])">{{::view.dates[35].label}}\n                    </td>\n                    <td ng-click="select(view.dates[36].date)"\n                        ng-class="getHighlightClass(view.dates[36])">{{::view.dates[36].label}}\n                    </td>\n                    <td ng-click="select(view.dates[37].date)"\n                        ng-class="getHighlightClass(view.dates[37])">{{::view.dates[37].label}}\n                    </td>\n                    <td ng-click="select(view.dates[38].date)"\n                        ng-class="getHighlightClass(view.dates[38])">{{::view.dates[38].label}}\n                    </td>\n                    <td ng-click="select(view.dates[39].date)"\n                        ng-class="getHighlightClass(view.dates[39])">{{::view.dates[39].label}}\n                    </td>\n                    <td ng-click="select(view.dates[40].date)"\n                        ng-class="getHighlightClass(view.dates[40])">{{::view.dates[40].label}}\n                    </td>\n                    <td ng-click="select(view.dates[41].date)"\n                        ng-class="getHighlightClass(view.dates[41])">{{::view.dates[41].label}}\n                    </td>\n                </tr>\n                </tbody>\n            </table>\n            <table ng-if="$index!==currentViewIndex" class="table table-bordered monthview-datetable">\n                <thead>\n                <tr class="text-center">\n                    <th>\n                        <small>Sun</small>\n                    </th>\n                    <th>\n                        <small>Mon</small>\n                    </th>\n                    <th>\n                        <small>Tue</small>\n                    </th>\n                    <th>\n                        <small>Wed</small>\n                    </th>\n                    <th>\n                        <small>Thu</small>\n                    </th>\n                    <th>\n                        <small>Fri</small>\n                    </th>\n                    <th>\n                        <small>Sat</small>\n                    </th>\n                </tr>\n                </thead>\n                <tbody>\n                <tr>\n                    <td>{{::view.dates[0].label}}</td>\n                    <td>{{::view.dates[1].label}}</td>\n                    <td>{{::view.dates[2].label}}</td>\n                    <td>{{::view.dates[3].label}}</td>\n                    <td>{{::view.dates[4].label}}</td>\n                    <td>{{::view.dates[5].label}}</td>\n                    <td>{{::view.dates[6].label}}</td>\n                </tr>\n                <tr>\n                    <td>{{::view.dates[7].label}}</td>\n                    <td>{{::view.dates[8].label}}</td>\n                    <td>{{::view.dates[9].label}}</td>\n                    <td>{{::view.dates[10].label}}</td>\n                    <td>{{::view.dates[11].label}}</td>\n                    <td>{{::view.dates[12].label}}</td>\n                    <td>{{::view.dates[13].label}}</td>\n                </tr>\n                <tr>\n                    <td>{{::view.dates[14].label}}</td>\n                    <td>{{::view.dates[15].label}}</td>\n                    <td>{{::view.dates[16].label}}</td>\n                    <td>{{::view.dates[17].label}}</td>\n                    <td>{{::view.dates[18].label}}</td>\n                    <td>{{::view.dates[19].label}}</td>\n                    <td>{{::view.dates[20].label}}</td>\n                </tr>\n                <tr>\n                    <td>{{::view.dates[21].label}}</td>\n                    <td>{{::view.dates[22].label}}</td>\n                    <td>{{::view.dates[23].label}}</td>\n                    <td>{{::view.dates[24].label}}</td>\n                    <td>{{::view.dates[25].label}}</td>\n                    <td>{{::view.dates[26].label}}</td>\n                    <td>{{::view.dates[27].label}}</td>\n                </tr>\n                <tr>\n                    <td>{{::view.dates[28].label}}</td>\n                    <td>{{::view.dates[29].label}}</td>\n                    <td>{{::view.dates[30].label}}</td>\n                    <td>{{::view.dates[31].label}}</td>\n                    <td>{{::view.dates[32].label}}</td>\n                    <td>{{::view.dates[33].label}}</td>\n                    <td>{{::view.dates[34].label}}</td>\n                </tr>\n                <tr>\n                    <td>{{::view.dates[35].label}}</td>\n                    <td>{{::view.dates[36].label}}</td>\n                    <td>{{::view.dates[37].label}}</td>\n                    <td>{{::view.dates[38].label}}</td>\n                    <td>{{::view.dates[39].label}}</td>\n                    <td>{{::view.dates[40].label}}</td>\n                    <td>{{::view.dates[41].label}}</td>\n                </tr>\n                </tbody>\n            </table>\n        </ion-slide>\n    </ion-slide-box>\n    <ion-content class="event-detail-container" has-bouncing="false">\n        <table class="table table-bordered table-striped table-fixed event-detail-table">\n            <tr ng-repeat="event in selectedDate.events" ng-click="eventSelected({event:event})">\n                <td ng-if="!event.allDay" class="monthview-eventdetail-timecolumn">{{::event.startTime|date: \'HH:mm\'}}\n                    -\n                    {{::event.endTime|date: \'HH:mm\'}}\n                </td>\n                <td ng-if="event.allDay" class="monthview-eventdetail-timecolumn">All day</td>\n                <td class="event-detail">{{::event.title}}</td>\n            </tr>\n            <tr ng-if="!selectedDate.events">\n                <td class="no-event-label">No Events</td>\n            </tr>\n        </table>\n    </ion-content>\n</div>\n\n');
  }]),angular.module("templates/rcalendar/week.html",[]).run(["$templateCache",function($templateCache){$templateCache.put("templates/rcalendar/week.html",'<div class="weekview">\n    <ion-slide-box class="weekview-slide" on-slide-changed="slideChanged($index)" does-continue="true"\n                   show-pager="false">\n        <ion-slide ng-repeat="view in views track by $index">\n            <table class="table table-bordered table-fixed weekview-header">\n                <thead>\n                <tr>\n                    <th class="calendar-hour-column"></th>\n                    <th class="weekview-header text-center" ng-repeat="dt in view.dates">{{::dt.date| date: \'EEE d\'}}</span></th>\n                </tr>\n                </thead>\n            </table>\n            <div ng-if="$index===currentViewIndex">\n                <div class="weekview-allday-table">\n                    <div class="weekview-allday-label">\n                        all day\n                    </div>\n                    <ion-scroll zooming="true" direction="y" class="weekview-allday-content-wrapper"\n                                has-bouncing="false">\n                        <table class="table table-bordered table-fixed weekview-allday-content-table">\n                            <tbody>\n                            <tr>\n                                <td ng-repeat="day in view.dates track by day.date" class="calendar-cell">\n                                    <div ng-class="{\'calendar-event-wrap\': day.events}" ng-if="day.events">\n                                        <div ng-repeat="displayEvent in day.events" class="calendar-event"\n                                             ng-click="eventSelected({event:displayEvent.event})"\n                                             ng-style="{top: 25*displayEvent.position+\'px\', width: 100*(displayEvent.endIndex-displayEvent.startIndex)+\'%\', height: \'25px\'}">\n                                            <div class="calendar-event-inner">{{displayEvent.event.title}}</div>\n                                        </div>\n                                    </div>\n                                </td>\n                            </tr>\n                            </tbody>\n                        </table>\n                    </ion-scroll>\n                </div>\n                <ion-content class="weekview-normal-event-container" has-bouncing="false">\n                    <table class="table table-bordered table-fixed weekview-normal-event-table">\n                        <tbody>\n                        <tr ng-repeat="row in view.rows track by $index">\n                            <td class="calendar-hour-column text-center">\n                                {{::$index<12?($index === 0?12:$index)+\'am\':($index === 12?$index:$index-12)+\'pm\'}}\n                            </td>\n                            <td ng-repeat="tm in row track by tm.time" class="calendar-cell" ng-click="select(tm.time)">\n                                <div ng-class="{\'calendar-event-wrap\': tm.events}" ng-if="tm.events">\n                                    <div ng-repeat="displayEvent in tm.events" class="calendar-event"\n                                         ng-click="eventSelected({event:displayEvent.event})"\n                                         ng-style="{left: 100/displayEvent.overlapNumber*displayEvent.position+\'%\', width: 100/displayEvent.overlapNumber+\'%\', height: 37*(displayEvent.endIndex-displayEvent.startIndex)+\'px\'}">\n                                        <div class="calendar-event-inner">{{displayEvent.event.title}}</div>\n                                    </div>\n                                </div>\n                            </td>\n                        </tr>\n                        </tbody>\n                    </table>\n                </ion-content>\n            </div>\n            <div ng-if="$index!==currentViewIndex">\n                <div class="weekview-allday-table">\n                    <div class="weekview-allday-label">\n                        all day\n                    </div>\n                    <ion-scroll zooming="true" direction="y" class="weekview-allday-content-wrapper"\n                                has-bouncing="false">\n                        <table class="table table-bordered table-fixed weekview-allday-content-table">\n                            <tbody>\n                            <tr>\n                                <td ng-repeat="day in view.dates track by day.date" class="calendar-cell">\n                                </td>\n                            </tr>\n                            </tbody>\n                        </table>\n                    </ion-scroll>\n                </div>\n                <ion-content class="weekview-normal-event-container" has-bouncing="false">\n                    <table class="table table-bordered table-fixed weekview-normal-event-table">\n                        <tbody>\n                        <tr ng-repeat="row in view.rows track by $index">\n                            <td class="calendar-hour-column text-center">\n                                {{::$index<12?($index === 0?12:$index)+\'am\':($index === 12?$index:$index-12)+\'pm\'}}\n                            </td>\n                            <td ng-repeat="tm in row track by tm.time" class="calendar-cell">\n                            </td>\n                        </tr>\n                        </tbody>\n                    </table>\n                </ion-content>\n            </div>\n        </ion-slide>\n    </ion-slide-box>\n</div>')}]);