Permalink
Browse files

Fixing how dates are displayed on forums and forum posts.

  • Loading branch information...
jtgeibel committed Nov 24, 2011
1 parent bca2b39 commit 5fc17a006d4eacf241669c6b3b6867831b7e1f01
@@ -330,7 +330,7 @@ def time_ago_in_words(from_time, to_time = Time.now, include_seconds = false)
when 1..59 then :minutes_ago.l(:count => distance_in_minutes)
when 60..1440 then :hours_ago.l(:count => (distance_in_minutes.to_f / 60.0).round)
when 1440..2880 then :days_ago.l(:count => (distance_in_minutes.to_f / 1440.0).round) # 1.5 days to 2 days
- else I18n.l(from_time, :format => :time_ago)
+ else I18n.l(from_time.to_date, :format => :date_ago)
end
end
@@ -58,7 +58,7 @@
%td.ca.inv.stat= topic.sb_posts_count
%td.ca.inv.stat= number_with_delimiter(topic.views)
%td.lp
- %abbr.updated{:title=>"#{topic.replied_at.xmlschema}"}= time_ago_in_words(topic.replied_at)
+ %abbr.updated{:title=>"#{topic.replied_at}"}= time_ago_in_words(topic.replied_at)
= :by.l
%span.author
%strong.fn= h(topic.replied_by_user.display_name)
@@ -7,7 +7,7 @@
%td.author.vcard{:width => "15%"}
.date
%a{"href"=>"##{post.dom_id}", "rel"=>"bookmark"}
- %abbr.updated{"title"=>"#{post.created_at.xmlschema}"}= time_ago_in_words(post.created_at)
+ %abbr.updated{"title"=>"#{post.created_at}"}= time_ago_in_words(post.created_at)
-if post.user
= avatar_for post.user
@@ -32,4 +32,4 @@
%td.body.entry-content{"id"=>"post-body-#{post.id}", :width => '85%'}
= link_to_function image_tag('clearbits/comment.gif', :class => 'icon reply', :plugin => 'community_engine'), "$('reply').toggle()" if logged_in?
- = post.body_html
+ = post.body_html
@@ -32,7 +32,7 @@
%tr.post{ :id => post.dom_id }
%td.author.vcard
.date
- %abbr.updated{ :title => post.created_at.xmlschema }
+ %abbr.updated{ :title => post.created_at }
= time_ago_in_words(post.created_at)
= avatar_for @users[post.user_id]
@@ -27,9 +27,9 @@
<tr class="post hentry" id="<%= post.dom_id %>">
<td class="author vcard">
<div class="date">
- <abbr class="updated" title="<%= post.created_at.xmlschema %>">
+ <abbr class="updated" title="<%= post.created_at %>">
<% if post.created_at > Time.now.utc-24.hours%>
- <%= time_ago_in_words(post.created_at).sub(/about /, '') %> ago
+ <%= time_ago_in_words(post.created_at) %> ago
<% else %>
<%= post.created_at.strftime("%b %e, %Y")%>
<% end %>
View
@@ -2,15 +2,15 @@ en:
date:
formats:
published_date: "%m/%d/%Y"
- date_ago: "%b %Y"
+ date_ago: "%b %d, %Y"
time:
formats:
published_date: "%m/%d/%Y"
short_published_date: "%m/%d/%y"
literal_date: "%B %d, %Y"
short_literal_date: "%b %d, %Y"
- time_ago: "%l:%M%p"
+ time_ago: "%I:%M %P"
activerecord:
attributes:
@@ -1673,4 +1673,4 @@ en:
#en; cancel_and_go_back_to_photo_manager: "Cancel and go back to photo manager"
cancel_and_go_back_to_photo_manager: "Cancel and go back to photo manager"
#en: back_to_photo_manager: "Back to photo manager"
- back_to_photo_manager: "Back to photo manager"
+ back_to_photo_manager: "Back to photo manager"

0 comments on commit 5fc17a0

Please sign in to comment.