summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-07-05 07:39:07 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-07-05 07:39:07 +0000
commit1e6b8a482ae12d48fa72305d73891a2611db47c5 (patch)
tree249136cfa104b73aa147872dc251f26e386cd41e
parentfc42dd2cef3f1e43af19f6455011cdd5d298aef5 (diff)
downloadredmine-1e6b8a482ae12d48fa72305d73891a2611db47c5.tar.gz
redmine-1e6b8a482ae12d48fa72305d73891a2611db47c5.zip
Removes calls to TimeZone#adjust (#1584).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1626 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/helpers/application_helper.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 090d7b058..fdc541645 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -75,11 +75,7 @@ module ApplicationHelper
return nil unless time
time = time.to_time if time.is_a?(String)
zone = User.current.time_zone
- if time.utc?
- local = zone ? zone.adjust(time) : time.getlocal
- else
- local = zone ? zone.adjust(time.getutc) : time
- end
+ local = zone ? time.in_time_zone(zone) : (time.utc? ? time.utc_to_local : time)
@date_format ||= (Setting.date_format.blank? || Setting.date_format.size < 2 ? l(:general_fmt_date) : Setting.date_format)
@time_format ||= (Setting.time_format.blank? ? l(:general_fmt_time) : Setting.time_format)
include_date ? local.strftime("#{@date_format} #{@time_format}") : local.strftime(@time_format)