Project

General

Profile

Actions

Defect #30288

closed

Groups are incorrect when grouping by date without user timezone set

Added by Mizuki ISHIKAWA over 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Category:
Issues filter
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

The following problems may occur when grouping by date (TimeWithZone).
  1. group count is not displayed
  2. The displayed created_on and group name date are different
Precondition:
  1. Use PostgreSQL or MySQL
  2. Database time zone is JST (It is not just JST)
  3. User's time zone is unset (User.current.time_zone is nil)

pry(main)> Issue.find(3).created_on
Wed, 19 Jul 2006 19:07:27 UTC +00:00

pry(main)> Issue.find(2).created_on
Wed, 19 Jul 2006 19:04:21 UTC +00:00
pry(main)> Issue.find(2).created_on.localtime.to_date # JST
Thu, 20 Jul 2006

pry(main)> Issue.find(2).created_on.to_date # UTC
Wed, 19 Jul 2006

In environments where the above conditions apply, the test of "IssuesControllerTest#test_index_grouped_by_created_on [test/functional/issues_controller_test.rb:365]" fails.

related: #13803


Files

grouping_issues.png (73.4 KB) grouping_issues.png Mizuki ISHIKAWA, 2018-12-28 07:21
fix-30288-v1.patch (4.15 KB) fix-30288-v1.patch Mizuki ISHIKAWA, 2019-01-04 07:35

Related issues

Related to Redmine - Feature #13803: Implement grouping issues by date (start, due, creation, update, closing dates)ClosedJean-Philippe Lang

Actions
Related to Redmine - Defect #31620: ActivitiesControllerTest#test_previous_project_index fails depending on the current time and zoneClosedGo MAEDA

Actions
Actions

Also available in: Atom PDF