     @classList.add('inline-block') # necessiary to make this view visible
     @appendChild(@view)
 
-  # Tries to parse a time string and return a Date object and days string.
+  # Tries to parse an event spec and return a Date object.
   parseTime: (timeStr, day) ->
     dt = day
     if !dt
       dt = new Date()
 
-    time = timeStr.match(/([0123456]{1,7})?\s*(\d+)(?::(\d\d))?\s*(am|pm)?/i)
+    time = timeStr.match(@eventFormat)
     if !time
       return NaN
 
-    weekDay = time[1]
     hour = parseInt(time[2], 10)
     minute = parseInt(time[3], 10) || 0
     ampm = time[4]

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

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

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

  # Return next closest time from times to the current time, NaN otherwise.
  nextClosestTime: (currentDate, times) ->
    today = new Date()
    for time in times
      dt = @parseTime(time)
      days = @parseDays(time)
      if dt > currentDate && (!days || days.indexOf(today.getDay()) != -1)
        return dt

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

    return NaN
