From c39be899b629378c0a4e1dd4beab528ebcbffa6e Mon Sep 17 00:00:00 2001 From: Scott Gerring Date: Sat, 3 Nov 2012 13:18:40 +0800 Subject: Display 'last updated' using user's locale. Closes #10 --- javascripts/dashing.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'javascripts') 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' -- cgit v1.2.3