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
assets/scripts/app/models

View File

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