Add a duration and remaining time method to the Talk model.
|@@ -21,6 +21,16 @@ def self.for_venue(venue)|
|+ def duration|
|+ end_at - start_at|
|+ def remaining|
|+ remnants = end_at - Time.now|
|+ remnants = [duration, remnants].min # To cap it at the talk's length|
|+ [0, remnants].max # So that we don't end up with a negative time if it's in the past.|