         refresh_firemen(currentView, currentId)
     eventRender: (event, element) ->
       element.find('.fc-time').remove()
-      element        
+      element
     eventClick: ( event, jsEvent, view ) ->
       eventDiv = $(this)
       eventDivHtml = $(this).html()

          fireman_availability:
            "fireman_id"   : fireman_id
            "availability" : date
        success : (data) ->
          new_event =
            title: ""

            allDay: false
            id: data["id"]
          $('#calendar').fullCalendar('renderEvent', new_event)
      }).always ->
        eventDiv.html(eventDivHtml)
    eventRender: (event, element) ->
      element.find('.fc-time').remove()
      element
    eventClick : (calEvent, jsEvent, view) ->
      return if(new Date(calEvent.start) <= new Date())
      eventDiv = $(this)
      eventDivHtml = $(this).html()
      $.ajax({
        type: 'DELETE'
        url: '/firemen/' + fireman_id + '/fireman_availabilities/' + calEvent.id
        beforeSend: ->
          eventDiv.html('Chargement...')
        success : (data) ->
          $('#calendar').fullCalendar('removeEvents', calEvent._id)
      }).always ->
        eventDiv.html(eventDivHtml)
    viewRender : ( view, element ) ->
      # set data for each day to handle click
      $('.fc-day-header').each (index) ->
        current = moment(view.start)
        current.add(index, 'd')
        $( this ).data('date', current)
  })

  $('#calendar').on 'click', '.fc-day-header', ->
    currentDay = $(this).data('date')
    events = $('#calendar').fullCalendar('clientEvents', (event) ->
      return (event.start.diff(currentDay.startOf('day'), 'hours') == 0)
    )
