From ed50d42210eaf7ca216e9cd3a043b36aa68eb51d Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 7 May 2016 10:42:22 +0000 Subject: Replace Date.today with User.current.today (#22320). Depending on the offset between a user's configured timezone and the server timezone, Date.today may be more or less often wrong from the user's perspective, leading to things like issues marked as overdue too early or too late, or yesterday / tomorrow being displayed / selected where 'today' is intended. A test case illustrating the problem with Issue#overdue? is included Patch by Jens Kraemer. git-svn-id: http://svn.redmine.org/redmine/trunk@15379 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/activities_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/controllers/activities_controller.rb') diff --git a/app/controllers/activities_controller.rb b/app/controllers/activities_controller.rb index ce3f600ae..32df00f97 100644 --- a/app/controllers/activities_controller.rb +++ b/app/controllers/activities_controller.rb @@ -27,7 +27,7 @@ class ActivitiesController < ApplicationController begin; @date_to = params[:from].to_date + 1; rescue; end end - @date_to ||= Date.today + 1 + @date_to ||= User.current.today + 1 @date_from = @date_to - @days @with_subprojects = params[:with_subprojects].nil? ? Setting.display_subprojects_issues? : (params[:with_subprojects] == '1') if params[:user_id].present? -- cgit v1.2.3