diff options
author | Scott Gerring <scott@scotgerring.com> | 2012-11-03 13:18:40 +0800 |
---|---|---|
committer | Daniel Beauchamp <daniel.beauchamp@shopify.com> | 2012-12-04 01:02:20 -0300 |
commit | c39be899b629378c0a4e1dd4beab528ebcbffa6e (patch) | |
tree | 3a472708d9c2845934aa399c98ba8f8a0a3cd954 /javascripts | |
parent | 694f8d98ad751be221cc3156356b9e452638ce5f (diff) |
Display 'last updated' using user's locale. Closes #10
Diffstat (limited to 'javascripts')
-rw-r--r-- | javascripts/dashing.coffee | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/javascripts/dashing.coffee b/javascripts/dashing.coffee index 6662725..faf21a0 100644 --- a/javascripts/dashing.coffee +++ b/javascripts/dashing.coffee @@ -44,8 +44,10 @@ class Dashing.Widget extends Batman.View @accessor 'updatedAtMessage', -> if updatedAt = @get('updatedAt') - timestamp = updatedAt.toString().match(/\d*:\d*/)[0] - "Last updated at #{timestamp}" + timestamp = new Date(updatedAt * 1000) + hours = timestamp.getHours() + minutes = ("0" + timestamp.getMinutes()).slice(-2) + "Last updated at #{hours}:#{minutes}" @::on 'ready', -> Dashing.Widget.fire 'ready' |