Permalink
Browse files

abbreviated last updated time displayed but full datetime included in…

… title of span
  • Loading branch information...
1 parent f770074 commit b3f8f99085f8ea6b598de7ea9fca364872f4f701 @stevenwilkin committed May 1, 2009
Showing with 5 additions and 2 deletions.
  1. +3 −1 trends.rb
  2. +2 −1 views/index.haml
View
4 trends.rb
@@ -4,12 +4,14 @@
require 'sinatra'
require 'haml'
require 'json'
+require 'date'
get '/' do
file = File.expand_path(File.dirname(__FILE__)) + '/var/trends.json'
json = JSON.parse(File.read(file))
@trends = json['trends']
- @updated = json['as_of']
+ @updated_full = json['as_of']
+ @updated = DateTime.parse(@updated_full).strftime('%H:%S')
haml :index
end
View
3 views/index.haml
@@ -5,7 +5,8 @@
%li
·
%a{:href => t['url'], :title => "search twitter for '#{t['name']}'"}= t['name']
- == last updated #{@updated}
+ last updated
+ %span{:title => @updated_full}= @updated
#images
%ol

0 comments on commit b3f8f99

Please sign in to comment.