             $('.drm-calendar-week-prev, .drm-calendar-week-next').show()
             $('.drm-calendar-date-prev, .drm-calendar-date-next').hide()
 
-        _createDateView = (currentMonth, currentDate, currentYear) ->
+        _createDateView = (currentDate) ->
             dayListHtml = "<ul class='drm-week drm-day #{weekClass}' data-week='#{weekNumber}'>"
             $.each self.hours, (key, value) ->
                 hour = value.name
-                dayListHtml += "<li class='#{self.classes.date}' data-month='#{currentMonth}' data-date='#{currentDate}' data-year='#{currentYear}' data-day='#{day}' data-hour='#{hour}'><span class='hour'>#{hour}</span></li>"
+                dayListHtml += "<li class='#{self.classes.date}' data-month='#{currentDate.month}' data-date='#{currentDate.date}' 
+                    data-year='#{currentDate.year}' data-day='#{day}' data-hour='#{hour}'><span class='hour'>#{hour}</span></li>"
             dayListHtml += '</ul>'
 
             calendar = $ '<div></div>',
                 class: self.calendarInnerClass
-                'data-month': currentMonth
-                'data-year': currentYear
+                'data-month': currentDate.month
+                'data-year': currentDate.year
                 html: dayListHtml
 
             headingText = 
-                if currentMonth is self.currentMonth and currentDate is self.currentDate and currentYear is self.currentYear
-                    "Today, #{self.days[day]}, #{self.months[currentMonth]} #{currentDate} #{currentYear}"
+                if currentDate.month is self.today.month and currentDate is self.today.date and currentDate.year is self.today.year
+                    "Today, #{self.days[day]}, #{self.months[currentDate.month]} #{currentDate.date} #{currentDate.year}"
                 else
-                    "#{self.days[day]}, #{self.months[currentMonth]} #{currentDate} #{currentYear}"
+                    "#{self.days[day]}, #{self.months[currentDate.month]} #{currentDate.date} #{currentDate.year}"
 
             heading = $ '<h1></h1>',
                 class: 'drm-calendar-header'

            eventDates

        _addDailyEvents = (events, eventDates) ->
            days = if self.view is 'month' then calendarInner.find ".#{self.classes.date}" else calendarInner.find ".#{self.classes.date}[data-hour='All Day Event']"
            days.each ->
                eventDates.push $(@).data 'date'



    advanceDate: (direction) =>
        calendarInner = @calendar.find "div.#{@calendarInnerClass}"
        currentDate =
            month: calendarInner.data 'month'
            date: calendarInner.find(".#{@classes.date}").data 'date'
            year: calendarInner.data 'year'
        nextYear = currentDate.year + 1
        lastYear = currentDate.year - 1
        nextMonth = if currentDate.month is 11 then 0 else currentDate.month + 1
        lastMonth = if currentDate.month is 0 then 11 else currentDate.month - 1
        
        if direction is 'prev'
            lastDayOfPrevMonth = @getDaysInMonth lastMonth, currentDate.year

            if currentDate.date is 1
                currentDate.date = lastDayOfPrevMonth
                currentDate.year = if currentDate.month is 0 then lastYear else currentDate.year
                currentDate.month = lastMonth
            else
                currentDate.date = currentDate.date - 1

        else if direction is 'next'
            lastDayOfMonth = @getDaysInMonth currentDate.month, currentDate.year

            if currentDate.date is lastDayOfMonth
                currentDate.date = 1
                currentDate.year = if currentDate.month is 11 then nextYear else currentDate.year
                currentDate.month = nextMonth
            else
                currentDate.date = currentDate.date + 1

        if @view is 'date' then @changeCalendar currentDate

    advanceWeek: (direction) =>
        calendarInner = @calendar.find "div.#{@calendarInnerClass}"
        currentDate =
            month: calendarInner.data 'month'
            date: 1
            year: calendarInner.data 'year'
        nextYear = currentDate.year + 1
        lastYear = currentDate.year - 1
        nextMonth = if currentDate.month is 11 then 0 else currentDate.month + 1
        lastMonth = if currentDate.month is 0 then 11 else currentDate.month - 1
        
        if direction is 'prev'
            firstDay = calendarInner.find(".#{@classes.date}").first().data 'date'
            lastDayOfPrevMonth = @getDaysInMonth lastMonth, currentDate.year

            if firstDay is 1 and @view is 'week'
                currentDate.date = lastDayOfPrevMonth
                currentDate.year = if currentDate.month is 0 then lastYear else currentDate.year
                currentDate.month = lastMonth
            else if firstDay < 7 and @view is 'week'
                currentDate.date = firstDay - 1
            else if firstDay is 1 and @view is 'date'
                currentDate.date = lastDayOfPrevMonth - 6 # 30 - 6 1 24
                currentDate.year = if currentDate.month is 0 then lastYear else currentDate.year
                currentDate.month = lastMonth
            else if firstDay < 7 and @view is 'date'
                currentDate.date = lastDayOfPrevMonth - (7 - firstDay) # 31 - (7 - 3) = 27 27  28 - (7 - 6) = 27 6 27
                currentDate.year = if currentDate.month is 0 then lastYear else currentDate.year
                currentDate.month = lastMonth
            else
                currentDate.date = firstDay - 7

        else if direction is 'next'
            lastDay = calendarInner.find(".#{@classes.date}").last().data 'date'
            lastDayOfMonth = @getDaysInMonth currentDate.month, currentDate.year

            if lastDay is lastDayOfMonth and @view is 'week'
                currentDate.date = 1
                currentDate.year = if currentDate.month is 11 then nextYear else currentDate.year
                currentDate.month = nextMonth
            else if (lastDay + 7 > lastDayOfMonth) and @view is 'week'
                currentDate.date = lastDayOfMonth
            else if (lastDay + 7 > lastDayOfMonth) and @view is 'date'
                currentDate.date = 7 - (lastDayOfMonth - lastDay) # 31 - 29 = 2 then 7 - 2 = 5
                currentDate.year = if currentDate.month is 11 then nextYear else currentDate.year
                currentDate.month = nextMonth
            else
                currentDate.date = lastDay + 7

        if @view is 'date' or @view is 'week' then @changeCalendar currentDate

    advanceMonth: (direction) =>
        self = @
        calendarInner = @calendar.find "div.#{@calendarInnerClass}"
        currentDate =
            month: calendarInner.data 'month'
            date: if @month is self.today.month then self.today.date else 1
            year: calendarInner.data 'year'
        
        if direction is 'prev'
            currentDate.month = if currentDate.month is 0 then 11 else currentDate.month - 1
            currentDate.year = if currentDate.month is 11 then currentDate.year - 1 else currentDate.year
        else if direction is 'next'
            currentDate.month = if currentDate.month is 11 then 0 else currentDate.month + 1
            currentDate.year = if currentDate.month is 0 then currentDate.year + 1 else currentDate.year
        @changeCalendar currentDate

    advanceYear: (direction) =>
        self = @
        calendarInner = @calendar.find "div.#{@calendarInnerClass}"
        currentDate =
            month: calendarInner.data 'month'
            year: calendarInner.data 'year'

        currentDate.date = if currentDate.month is self.today.month then self.today.date else 1
        currentDate.year = if direction is 'prev' then currentDate.year - 1 else currentDate.year + 1
        
        @changeCalendar currentDate

    changeCalendarView: (view) =>
        self = @
        calendarInner = @calendar.find "div.#{@calendarInnerClass}"
        currentDate =
            month: calendarInner.data 'month'
            year: calendarInner.data 'year'

        currentDate.date = if currentDate.month is self.today.month then self.today.date else 1     

        # update view
        @view = view
        @changeCalendar currentDate
        # change calendar class
        @calendarInnerClass = "drm-calendar-#{view}-view"
        @calendarInnerClass

    changeCalendar: (currentDate) =>
        self = @
        calendarInner = self.calendar.find "div.#{self.calendarInnerClass}"
        calendarInner.fadeOut(300).queue (next) ->
            $.when(calendarInner.remove()).then(self.createCalendar(currentDate))
            next()

    createCalendar: (currentDate) =>
        self = @
        nextYear = currentDate.year + 1
        lastYear = currentDate.year - 1
        nextMonth = if currentDate.month is 11 then 0 else currentDate.month + 1
        lastMonth = if currentDate.month is 0 then 11 else currentDate.month - 1
        firstDay = self.getDayOfWeek currentDate.month, 1, currentDate.year
        dayShift = if firstDay is self.daysPerWeek then 0 else firstDay
        numberDays = self.getDaysInMonth currentDate.month, currentDate.year
        numberWeeks = self.getWeeksInMonth currentDate.month, currentDate.year
        prevMonthNumberDays = self.getDaysInMonth lastMonth, currentDate.year
        weekInfo = self.getDatesInWeek currentDate.month, currentDate.date, currentDate.year
        datesInWeek = weekInfo.datesInWeek
        weekNumber = self.getWeekNumber currentDate.month, currentDate.date, currentDate.year
        weekClass = if weekNumber % 2 is 0 then 'even-week' else 'odd-week'
        day = self.getDayOfWeek currentDate.month, currentDate.date, currentDate.year

        _highlightWeekends = ->
            calendarInner = self.calendar.find "div.#{self.calendarInnerClass}"
