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

Bug 578732

Summary: Wrong UI represenation for date after editing text field in DateTime widget
Product: [RT] RAP Reporter: ANS <ans.mail>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: 3.14   
Target Milestone: 3.20   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/c/rap/org.eclipse.rap/+/190898
https://git.eclipse.org/c/rap/org.eclipse.rap.git/commit/?id=6af7c39ccec990e47a44c5896ec2a2f972c18714
Whiteboard:

Description ANS CLA 2022-02-14 07:59:52 EST
GUI shows wrong date after manual editing of 'day' text field in February.
Snippet to reproduce:

void testDateTimeWidget(final Composite parent) {
	final DateTime dt = new DateTime(parent, SWT.MEDIUM);
	dt.setDate(2022, 1, 10); 

        // GUI shows correct date of 10.2.2022
	// then:
	// 1. edit day text field with keyboard (or spinner)
	// 2. press 'Test' button
	// 3. GUI shows wrong date of 3.1.2022 (internal value is 31)

	final Button testDT = new Button(parent, SWT.NONE);
	testDT.setText("Test");
	testDT.addSelectionListener(new SelectionAdapter() {

		@Override
		public void widgetSelected(final SelectionEvent e) {
			dt.setDate(2022, 0, 31);
			System.out.println("day: " + dt.getDay());
		}

	});
}
Comment 1 Eclipse Genie CLA 2022-02-17 04:44:51 EST
New Gerrit change created: https://git.eclipse.org/r/c/rap/org.eclipse.rap/+/190898