summaryrefslogtreecommitdiff
path: root/javascripts
diff options
context:
space:
mode:
authorDaniel Beauchamp <daniel.beauchamp@shopify.com>2012-08-24 18:33:10 -0400
committerDaniel Beauchamp <daniel.beauchamp@shopify.com>2012-08-24 18:33:10 -0400
commita4f10ed0084f2eb3801a64fc8ea8e8fea8e2540d (patch)
treebdaef11e702ee3122e0c726d46df5b540818feb3 /javascripts
parent372ee8475ef9b685e8cd3b8dea2e0475d5a4bd6b (diff)
Widgets now have a formatted 'updatedAtMessage'. For stuff like 'Last updated at 18:00'
Diffstat (limited to 'javascripts')
-rw-r--r--javascripts/dashing.coffee4
1 files changed, 4 insertions, 0 deletions
diff --git a/javascripts/dashing.coffee b/javascripts/dashing.coffee
index 61c3fbe..964cf2c 100644
--- a/javascripts/dashing.coffee
+++ b/javascripts/dashing.coffee
@@ -41,6 +41,10 @@ class Dashing.Widget extends Batman.View
type = Batman.Filters.dashize(@view)
$(@node).addClass("widget widget-#{type} #{@id}")
+ @accessor 'updatedAtMessage', ->
+ if updatedAt = @get('updatedAt')
+ timestamp = updatedAt.toString().match(/\d*:\d*/)[0]
+ "Last updated at #{timestamp}"
@::on 'ready', ->
Dashing.Widget.fire 'ready'