Project

General

Profile

Patch #6729 » fix_localized_weekday_and_month_names.patch

Albert Rosenfield, 2010-10-22 22:51

View differences:

lib/redmine/i18n.rb 2010-10-20 16:37:31.612267815 +0200 → lib/redmine/i18n.rb 2010-10-20 23:47:41.962268688 +0200
def format_date(date)
return nil unless date
Setting.date_format.blank? ? ::I18n.l(date.to_date, :count => date.strftime('%d')) : date.strftime(Setting.date_format)
return ::I18n.l(date.to_date, :count => date.strftime('%d')) if Setting.date_format.blank?
fmt = Setting.date_format.dup
fmt.gsub!('%a', abbr_day_name(date.day))
fmt.gsub!('%A', day_name(date.day))
fmt.gsub!('%b', abbr_month_name(date.month))
fmt.gsub!('%B', month_name(date.month))
return date.strftime(fmt)
end
def format_time(time, include_date = true)
......
((include_date ? "#{format_date(time)} " : "") + "#{local.strftime(Setting.time_format)}")
end
def abbr_day_name(day)
::I18n.t('date.abbr_day_names')[day % 7]
end
def day_name(day)
::I18n.t('date.day_names')[day % 7]
end
def abbr_month_name(month)
::I18n.t('date.abbr_month_names')[month]
end
def month_name(month)
::I18n.t('date.month_names')[month]
end
    (1-1/1)