     # clear existing styles
     $alert.removeClass("alert-success")
     $alert.removeClass("alert-danger")
-    
+
     $alert.text(msg)
 
     if state == "success"

      dataType: "json"
      data: JSON.stringify {duration, timestamp, comment}
    )
    .done( -> 
      
      setTimeout(
        ->
          if isUserComingFromGithub()


  datepicker.on "changeDate", (event) ->
    currentDate = moment(event.date.valueOf())
    datepicker.datepicker("hide")

  datepicker.datepicker("setValue", currentDate.toDate())
  datepicker.datepicker('update')
