Don't try to format date if it does not exist

This commit is contained in:
Piotr Sarnacki 2013-10-01 14:29:55 +02:00
parent 01e0362242
commit 9c7606ff96
2 changed files with 4 additions and 2 deletions

View File

@ -78,7 +78,8 @@ require 'travis/model'
@_super(key)
formattedFinishedAt: (->
moment(@get('finishedAt')).format('lll')
if finishedAt = @get('finishedAt')
moment(finishedAt).format('lll')
).property('finishedAt')
@Travis.Build.reopenClass

View File

@ -106,7 +106,8 @@ require 'travis/model'
# to use it there easily, I would have to refactor job and build
# controllers
formattedFinishedAt: (->
moment(@get('finishedAt')).format('lll')
if finishedAt = @get('finishedAt')
moment(finishedAt).format('lll')
).property('finishedAt')
@Travis.Job.reopenClass