Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347824 - SWTBotDateTime.setDate does not set the expected date in some cases
Summary: SWTBotDateTime.setDate does not set the expected date in some cases
Status: RESOLVED FIXED
Alias: None
Product: SWTBot
Classification: Technology
Component: SWTBot (show other bugs)
Version: 2.0.0-dev   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-31 12:04 EDT by Cédric Chabanois CLA
Modified: 2011-06-09 10:56 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cédric Chabanois CLA 2011-05-31 12:04:15 EDT
Build Identifier: M20110210-1200

Say DateTime widget date is set to May 31 2011.

We now call SWTBotDateTime.setDate(date) where date is Sep 28 2010, the dateTime widget will display May 28 2010 instead (month change is ignored because Sep 31 2011 is not a valid date).

SWTBotDateTime should use 
widget.setDate(toSet.getYear() + 1900, toSet.getMonth(), toSet.getDate());

instead of

widget.setYear(toSet.getYear() + 1900);
widget.setMonth(toSet.getMonth());
widget.setDay(toSet.getDate());

Reproducible: Always