Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330144 - Grouping by quarter on Date data type is incorrect when time zone is west of OS default
Summary: Grouping by quarter on Date data type is incorrect when time zone is west of ...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: 3.7.0 M7   Edit
Assignee: xiaofeng zhang CLA
QA Contact: Xiaoying Gu CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-12 16:17 EST by Mark Mising name CLA
Modified: 2011-05-17 04:23 EDT (History)
1 user (show)

See Also:


Attachments
Test case for grouping Date data by quarter (25.88 KB, application/octet-stream)
2010-11-12 16:19 EST, Mark Mising name CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Mising name CLA 2010-11-12 16:17:13 EST
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)
Comment 1 Mark Mising name CLA 2010-11-12 16:19:47 EST
Created attachment 183046 [details]
Test case for grouping Date data by quarter
Comment 2 xiaofeng zhang CLA 2011-05-17 04:23:44 EDT
The server time zone should not be applied to java.sql.Date object when calculating quarter. Fix this issue.