Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 547508

Summary: [DateTime] Weekday labels are incorrect for some months if the week does not start with Monday
Product: [RT] RAP Reporter: Ago Kuusik <akuusik>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.6   
Target Milestone: 3.13   
Hardware: PC   
OS: Windows 10   
See Also: https://git.eclipse.org/r/161554
https://git.eclipse.org/c/rap/org.eclipse.rap.git/commit/?id=97cc64422ea2339356accff2c72c067d3b5290e8
Whiteboard:

Description Ago Kuusik CLA 2019-05-21 07:21:13 EDT
For locales where the start day of week is not Monday, the weekday labels in the calendar drop-down of DateTime widget are calculated incorrectly for some months. For example: Icelandic, April 2019: sun., fös., lau., sun., mán., þri, mið. 

The bug 547507 prevents exposing this issue for other countries/languages like US English.

The reason of this issue seems to be in bundle org.eclipse.rap.rwt, Javascript file rwt/widgets/base/Calendar.js, function _updateDatePane. The line 

helpDate.setDate(firstSundayInMonth + day);

moves helpDate to the previous month if the argument is 0. Subsequent  helpDate.setDate() calls in this loop will use the date in a wrong month. Creating a new date instead should prevent this:

helpDate = new Date(this.getShownYear(), this.getShownMonth(), firstSundayInMonth + day);
Comment 1 Ivan Furnadjiev CLA 2019-06-26 05:57:01 EDT
Could you provide a Gerrit change without your suggestion?
Comment 2 Eclipse Genie CLA 2020-04-27 04:20:22 EDT
New Gerrit change created: https://git.eclipse.org/r/161554