Community
Participate
Working Groups
Build Identifier: 2.6.1.v20100902 If the run and render tasks are assigned a time zone that is west of the OS time zone, then grouping by the BirtDateTime.quarter function on Date data is grouped into the previous quarter. This is a result of the JavaScript engine using a java.util.Date instance for the data value instead of the java.sql.Date instances in the data rows. This is a problem since the BirtDateTime.quarter function looks at the class of the value to determine whether to adjust the value by the time zone offset. Normally, this would not be done for java.sql.Date objects (as is the case when the value is formatted for display). This makes it impossible to reliably use Date type data in script functions when rendering for a time zone other than the server. Reproducible: Always Steps to Reproduce: 1. Open the attached report in the RCP designer 2. Preview the report (notice that there are two quarter groups) 3. Click the (Click to change Preview Preferences) link and change the time zone to a time zone west of the OS...e.g., if the OS is on Eastern Standard Time, change the preview preference to Pacific Standard Time) 4. Click OK and Yes to confirm refresh (notice that now April 1 was grouped into Q1 instead of Q2)
Created attachment 183046 [details] Test case for grouping Date data by quarter
The server time zone should not be applied to java.sql.Date object when calculating quarter. Fix this issue.