summaryrefslogtreecommitdiffstats
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-05-26 12:07:56 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-05-26 12:07:56 +0000
commit189be55235b75c32908a4037825b453513673e64 (patch)
treea1bfcc244fa32c7e326487d145ec1b6232d51a5b /app/models/user.rb
parent84084b01689718ea901dcd66d66ab676c7bc4790 (diff)
downloadredmine-189be55235b75c32908a4037825b453513673e64.tar.gz
redmine-189be55235b75c32908a4037825b453513673e64.zip
Fixed time zone issues introduced by r9719 (#10996).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9726 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index e59c752b2..904420315 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -370,6 +370,15 @@ class User < Principal
end
end
+ # Returns the day of +time+ according to user's time zone
+ def time_to_date(time)
+ if time_zone.nil?
+ time.to_date
+ else
+ time.in_time_zone(time_zone).to_date
+ end
+ end
+
def logged?
true
end