   else
     value = ""
 
-  $("#{form_id} .time-difference").html(value)
-
+  $(".time-difference").html(value)
 
 $ ->
   # Do not put event listeners inside here (they will add up through turbolinks)

$(document).on 'ajax:error', '.reveal-modal form', (xhr, status, error) ->
  console.log xhr, status, error

$(document).on 'ajax:success', '.reveal-modal form', (data, status, xhr) ->
  $(this).foundation('reveal', 'close')
  window.location.reload()

$(document).on 'click', '.stop-timer', ->
  unless $('.stop-timer').hasClass 'disabled'
    $('.stop-timer i').removeClass('icon-spin')

$(document).on 'ajax:complete', '.stop-timer', (xhr, status) ->
  window.location.reload()

$(document).on 'click', '.unhider', ->
  $('.' + $(this).data('hide-class')).hide()

  false

$(document).on 'keyup', '.reveal-modal.time form #time_entry_end_time, .reveal-modal.time form #time_entry_start_time', ->
  startEl = $("#time_entry_start_time")
  endEl   = $("#time_entry_end_time")

  if endEl.val()
    $("#time_entry_submit").val(I18n.t('time_entries.form.save'))
  else
    $("#time_entry_submit").val(I18n.t('time_entries.form.start_timer'))

  startValue = $.fn.timepicker.parseTime startEl.val()
  endValue   = $.fn.timepicker.parseTime endEl.val()
