mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-08 01:04:39 +08:00
fix(timestamps): Don't crash on null times #1929
This commit is contained in:
parent
232f2cbbf5
commit
66e86d8f80
1 changed files with 2 additions and 0 deletions
|
@ -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) ->
|
||||
|
|
Loading…
Reference in a new issue