comparison lib/redmine/.svn/text-base/i18n.rb.svn-base @ 246:eeebe205a056 cannam

* Merge from default branch, bringing us up to SVN trunk rev 4993
author Chris Cannam
date Thu, 03 Mar 2011 12:02:03 +0000
parents 051f544170fe
children
comparison
equal deleted inserted replaced
138:fca2657f4aa5 246:eeebe205a056
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