mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-22 16:26:08 +08:00
fix(timestamps): Don't crash on null times #1929
This commit is contained in:
parent
9848f8f086
commit
2eab0e3a75
|
@ -56,6 +56,7 @@ Utils =
|
||||||
timeZone: tz
|
timeZone: tz
|
||||||
|
|
||||||
shortTimeString: (time) ->
|
shortTimeString: (time) ->
|
||||||
|
return "" unless time
|
||||||
diff = moment().diff(time, 'days', true)
|
diff = moment().diff(time, 'days', true)
|
||||||
if diff <= 1
|
if diff <= 1
|
||||||
format = "h:mm a"
|
format = "h:mm a"
|
||||||
|
@ -66,6 +67,7 @@ Utils =
|
||||||
moment(time).format(format)
|
moment(time).format(format)
|
||||||
|
|
||||||
fullTimeString: (time) ->
|
fullTimeString: (time) ->
|
||||||
|
return "" unless time
|
||||||
moment(time).tz(Utils.timeZone).format("dddd, MMMM Do YYYY, h:mm:ss a z")
|
moment(time).tz(Utils.timeZone).format("dddd, MMMM Do YYYY, h:mm:ss a z")
|
||||||
|
|
||||||
fastOmit: (props, without) ->
|
fastOmit: (props, without) ->
|
||||||
|
|
Loading…
Reference in a new issue