localize dates
This commit is contained in:
parent
2c06397fd9
commit
6e0e46435e
3 changed files with 8 additions and 4 deletions
|
|
@ -20,7 +20,7 @@ class NotificationsController < ApplicationController
|
||||||
def index
|
def index
|
||||||
@notifications = Notification.find(:all, :conditions => {:recipient_id => current_user.id},
|
@notifications = Notification.find(:all, :conditions => {:recipient_id => current_user.id},
|
||||||
:order => 'updated_at desc', :include => [:target, {:actors => :profile}]).paginate :page => params[:page], :per_page => 25
|
:order => 'updated_at desc', :include => [:target, {:actors => :profile}]).paginate :page => params[:page], :per_page => 25
|
||||||
@group_days = @notifications.group_by{|note| note.updated_at.strftime("%B %d") }
|
@group_days = @notifications.group_by{|note| I18n.l(note.updated_at, :format => I18n.t('date.formats.fullmonth_day')) }
|
||||||
respond_with @notifications
|
respond_with @notifications
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,9 @@ module PeopleHelper
|
||||||
|
|
||||||
def birthday_format(bday)
|
def birthday_format(bday)
|
||||||
if bday.year == 1000
|
if bday.year == 1000
|
||||||
bday.strftime("%B %d")
|
I18n.l bday, :format => I18n.t('date.formats.birthday')
|
||||||
else
|
else
|
||||||
bday.strftime("%B %d %Y")
|
I18n.l bday, :format => I18n.t('date.formats.birthday_with_year')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -497,4 +497,8 @@ en:
|
||||||
pagination:
|
pagination:
|
||||||
next: "Next"
|
next: "Next"
|
||||||
previous: "Previous"
|
previous: "Previous"
|
||||||
|
date:
|
||||||
|
formats:
|
||||||
|
fullmonth_day: "%B %d"
|
||||||
|
birthday: "%B %d"
|
||||||
|
birthday_with_year: "%B %d %Y"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue