                 @date.format('MMMM YYYY')
 
     events:
+        'change:range': 'fetchEvents'
         'change:customer_project_id': 'fetchEvents'
 
     constructor: ->

        query.start_at  = { op: 'lt', value: range.end.toISOString() }
        @fetch({query})

    setProjectId: (projectId, range) ->
        return if @projectId is projectId
        @projectId = projectId
        query = if @projectId and @projectId isnt -1
            {customer_project_id: @projectId}

        @entries.load(@range)

    fetchEvents: ->
        @entries.reset(@customer_project_id, @range)

    calEvents: ->
        @_cachedEvents ||= new LC.Calendar.Events( @entries.invoke('toCalEvent') )

    back: ->
        @date = @date.clone().subtract(1, @display)
        @trigger('change', @)

    forward: ->
        @date = @date.clone().add(1, @display)
        @trigger('change', @)
