localize dates

This commit is contained in:
MrZYX 2011-02-08 16:26:56 +01:00
parent 2c06397fd9
commit 6e0e46435e
3 changed files with 8 additions and 4 deletions

View file

@ -20,7 +20,7 @@ class NotificationsController < ApplicationController
def index
@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
@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
end

View file

@ -22,9 +22,9 @@ module PeopleHelper
def birthday_format(bday)
if bday.year == 1000
bday.strftime("%B %d")
I18n.l bday, :format => I18n.t('date.formats.birthday')
else
bday.strftime("%B %d %Y")
I18n.l bday, :format => I18n.t('date.formats.birthday_with_year')
end
end
end

View file

@ -497,4 +497,8 @@ en:
pagination:
next: "Next"
previous: "Previous"
date:
formats:
fullmonth_day: "%B %d"
birthday: "%B %d"
birthday_with_year: "%B %d %Y"