fix(timestamps): Don't crash on null times #1929

This commit is contained in:
Ben Gotow 2016-04-11 16:17:51 -07:00
parent 9848f8f086
commit 2eab0e3a75

View file

@ -56,6 +56,7 @@ Utils =
timeZone: tz
shortTimeString: (time) ->
return "" unless time
diff = moment().diff(time, 'days', true)
if diff <= 1
format = "h:mm a"
@ -66,6 +67,7 @@ Utils =
moment(time).format(format)
fullTimeString: (time) ->
return "" unless time
moment(time).tz(Utils.timeZone).format("dddd, MMMM Do YYYY, h:mm:ss a z")
fastOmit: (props, without) ->