From a4f10ed0084f2eb3801a64fc8ea8e8fea8e2540d Mon Sep 17 00:00:00 2001 From: Daniel Beauchamp Date: Fri, 24 Aug 2012 18:33:10 -0400 Subject: Widgets now have a formatted 'updatedAtMessage'. For stuff like 'Last updated at 18:00' --- javascripts/dashing.coffee | 4 ++++ 1 file changed, 4 insertions(+) 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' -- cgit v1.2.3