Community
Participate
Working Groups
Build Identifier: I20090611-1540 On the control DateTime created with constraints SWT.DATE | SWT.DROP_DOWN, selecting on the calendar the month of June, and then selecting the first day visible on the calendar box (in this case the last day of May, the 31 in gray), the DateTime control show correctly 31/05/2010 but the method getDay() on the dateTime control return wrongly 7. However the control return the correct day if the 31th of May is selected from the May month view. Reproducible: Always Steps to Reproduce: 1. Create a DateTime control with constraints SWT.DATE | SWT.DROP_DOWN 2. Open the calendar view, go to June month of 2010 and select the first day visible in gray, the 31 of May 3. The control show correctly 31/05/2010 4. read the day from code using the method getDay(), it return 7 instead of 31
It always happens, when you choose a "day", that has not existed in the month you are "coming from". "Always" applies to: when you type the digits directly into the widget. Initial date: "xx.02.2010" Target date: "30.01.2010" or "31.03.2010" or "29.04.2010" and so on Exact steps: Just click the month-digits and type "01" for january, then click the day-digits and type "30" or "030" for the 30. of january. The date is correctly displayed, but wrong returned via getDay() from the control.
The problem was in DateTimeDateLCA where the new date was set field by field in readData(). Fixed in CVS HEAD. JUnit test added.
*** Bug 335948 has been marked as a duplicate of this bug. ***
Created attachment 188040 [details] Patch against v13_Maintenance
Comment on attachment 188040 [details] Patch against v13_Maintenance I consider this patch safe to go even into 1.3.2 RC3. The bug causes data inconsistencies and the fix involves no risk.
Applied patch to v13_Maintenance branch after discussion with Rüdiger.