Project

General

Profile

Defect #30288

Updated by Marius BÄ‚LTEANU over 5 years ago

The following problems may occur when grouping by date (TimeWithZone). 
 # group count is not displayed 
 # The displayed created_on and group name date are different 

 Precondition: 
 # Use PostgreSQL or MySQL 
 # Database time zone is JST (It is not just JST) 
 # User's time zone is unset (User.current.time_zone is nil) 

 !{width: 70%; border: 1px solid #ccc}grouping_issues.png! 

 <pre> 
 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 
 </pre> 

 <pre> 
 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 
 </pre> 

 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 http://www.redmine.org/issues/13803

Back