       period = step.step
       amount = step.amount
 
-      scope.steps = for i in [0..amount] by 1
+      scope.steps = for i in [0..amount - 1] by 1
         currentStep = {
           past: step.compare(stepDate, scope.position) < 0
           future: step.compare(stepDate, scope.position) > 0

    )

    scope.$next = ->
      scope.position = moment(moment(scope.position) + (3 * viewsSteps[scope.view].step)).toDate()

    scope.$previous = ->
      scope.position = moment(moment(scope.position) + (3 * viewsSteps[scope.view].step)).toDate()

    selecting = null
    changeRange = (newDate) ->


      return stepsByWeek

    scope.$watchGroup(['minDate', 'maxDate', 'steps'], ->
      return if not scope.steps?
      for step in scope.steps
        stepDate = moment(step.value)
