comparison lib/redmine/i18n.rb @ 245:051f544170fe

* Update to SVN trunk revision 4993
author Chris Cannam
date Thu, 03 Mar 2011 11:42:28 +0000
parents 8661b858af72
children cbb26bc654de
comparison
equal deleted inserted replaced
244:8972b600f4fb 245:051f544170fe
43 def format_time(time, include_date = true) 43 def format_time(time, include_date = true)
44 return nil unless time 44 return nil unless time
45 time = time.to_time if time.is_a?(String) 45 time = time.to_time if time.is_a?(String)
46 zone = User.current.time_zone 46 zone = User.current.time_zone
47 local = zone ? time.in_time_zone(zone) : (time.utc? ? time.localtime : time) 47 local = zone ? time.in_time_zone(zone) : (time.utc? ? time.localtime : time)
48 Setting.time_format.blank? ? ::I18n.l(local, :format => (include_date ? :default : :time)) : 48 (include_date ? "#{format_date(local)} " : "") +
49 ((include_date ? "#{format_date(time)} " : "") + "#{local.strftime(Setting.time_format)}") 49 (Setting.time_format.blank? ? ::I18n.l(local, :format => :time) : local.strftime(Setting.time_format))
50 end 50 end
51 51
52 def day_name(day) 52 def day_name(day)
53 ::I18n.t('date.day_names')[day % 7] 53 ::I18n.t('date.day_names')[day % 7]
54 end 54 end