summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--javascripts/dashing.coffee6
-rw-r--r--lib/dashing.rb2
2 files changed, 5 insertions, 3 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'
diff --git a/lib/dashing.rb b/lib/dashing.rb
index 7d066cc..37dc54d 100644
--- a/lib/dashing.rb
+++ b/lib/dashing.rb
@@ -81,7 +81,7 @@ end
def send_event(id, body)
body["id"] = id
- body["updatedAt"] = Time.now
+ body["updatedAt"] = Time.now.to_i
event = format_event(body.to_json)
settings.history[id] = event
settings.connections.each { |out| out << event }