     @refreshIntervalMiliseconds = 0
     @warnThresholdMiliseconds = 0
     @displayFormat = ''
+    @eventFormat = /([0123456]{1,7})?\s*(\d+)(?::(\d\d))?\s*(am|pm)?/i
 
     # TODO: Move this somewhere else?
     subscriptions.add atom.commands.add 'atom-workspace', 'event-watch:update': => @update()

    element.classList.add(classes...)
    return element

  # Return true if day is in the given days string or days is falsey.
  occursOn: (day, days) ->
    if !days
      return true

    dt = day
    if !dt
      dt = new Date()

    return days.indexOf(dt.getDay()) != -1

  # Return next closest time from times to the current time, NaN otherwise.
  nextClosestTime: (currentDate, times) ->
    today = new Date()
    for time in times
      [dt, days] = @parseTime(time)
      if dt > currentDate && @occursOn(today, days)
        return dt

    # fallback to earliest time tomorrow
    tomorrow = new Date()
    tomorrow.setDate(tomorrow.getDate() + 1)
    if times.length
      [dt, days] = @parseTime(times[0], tomorrow)
      if @occursOn(days, tomorrow)
        return dt

    return NaN

    dt.setHours(hour)
    dt.setMinutes(minute)
    dt.setSeconds(0, 0)
    return dt

  # Tries to parse an event spec for a days of the week list.
  parseDays: (timeStr) ->
    time = timeStr.match(@eventFormat)
    if !time
      return ''
    return time[1]

  # Returns time string formatted as HH:MM[p].
  formatTime: (date) ->
