Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

abbreviated last updated time displayed but full datetime included in…

… title of span
  • Loading branch information...
commit b3f8f99085f8ea6b598de7ea9fca364872f4f701 1 parent f770074
@stevenwilkin authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.