         _firstDay = @getDayOfWeek month, 1, year
         _dayShift = if _firstDay is @daysPerWeek then 0 else _firstDay
         _numberWeeks = @getWeeksInMonth month, year
-        _lastWeekLength = weeks.eq(numberWeeks).length
+        _lastWeekLength = _weeks.eq(_numberWeeks).length
 
         if dayNum is 'last' and _dayShift <= day
             eventWeekNum = if _lastWeekLength < day then (_numberWeeks - 2) else _numberWeeks - 1


        _daysInFirstWeek = @daysPerWeek - _dayShift

        i = 1
        # get the number of dates in each week
        while _i <= _numberWeeks
            dates = []


            # get the week number
            if newDate in dates
                weekInfo.weekNum = _i - 1
                weekInfo.datesInWeek = dates

            _i = _i + 1
        weekInfo

    getWeekNumber: (month, newDate, year) =>
