Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 263966 Details for
Bug 288164
Month selector in date dropdown has two March's.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Proposed patch
0001-Bug-288164-Month-selector-in-date-dropdown-has-two-M.patch (text/plain), 2.46 KB, created by
John Janus
on 2016-09-05 10:27:09 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
John Janus
Created:
2016-09-05 10:27:09 EDT
Size:
2.46 KB
patch
obsolete
>From 673ac7f089323beb665479adb725244fa3db838b Mon Sep 17 00:00:00 2001 >From: John Janus <j.janus@lighthouse-it.de> >Date: Mon, 5 Sep 2016 16:25:37 +0200 >Subject: [PATCH] Bug 288164 - Month selector in date dropdown has two March's. > >for the month dropdown, it suffices to use the 1st day of month in the >calendar instance to fix the two March's. > >The changing month mentioned in the comment can be fixed by setting the >selected date to the minimum of the actual maximum date for the month >and the selected date. >--- > .../eclipse/nebula/widgets/cdatetime/DatePicker.java | 17 +++++++++++++++-- > 1 file changed, 15 insertions(+), 2 deletions(-) > >diff --git a/widgets/cdatetime/org.eclipse.nebula.widgets.cdatetime/src/org/eclipse/nebula/widgets/cdatetime/DatePicker.java b/widgets/cdatetime/org.eclipse.nebula.widgets.cdatetime/src/org/eclipse/nebula/widgets/cdatetime/DatePicker.java >index 65feb41..527ebfc 100644 >--- a/widgets/cdatetime/org.eclipse.nebula.widgets.cdatetime/src/org/eclipse/nebula/widgets/cdatetime/DatePicker.java >+++ b/widgets/cdatetime/org.eclipse.nebula.widgets.cdatetime/src/org/eclipse/nebula/widgets/cdatetime/DatePicker.java >@@ -709,8 +709,17 @@ class DatePicker extends VPanel { > } > > Calendar tmpcal = cdt.getCalendarInstance(); >- tmpcal.set(Calendar.MONTH, >- (Integer) button.getData("Month")); //$NON-NLS-1$ >+ int tmpday = tmpcal.get(Calendar.DAY_OF_MONTH); >+ Integer tmpmonth = (Integer) button.getData("Month"); //$NON-NLS-1$ >+ /* >+ * : Bug 288164 keep the selected month by setting the day of month >+ * to the minimum of actual maximum and the selected date >+ */ >+ tmpcal.set(tmpcal.get(Calendar.YEAR), tmpmonth, 1); >+ if (tmpcal.getActualMaximum(Calendar.DAY_OF_MONTH)<tmpday) >+ tmpday = tmpcal.getActualMaximum(Calendar.DAY_OF_MONTH); >+ tmpcal.set(Calendar.DAY_OF_MONTH, tmpday); >+ tmpcal.set(Calendar.MONTH, tmpmonth); > cdt.setSelection(tmpcal.getTime()); > /* > * : Bug 388813 the method cdt.isClosingField checks the >@@ -1398,6 +1407,10 @@ class DatePicker extends VPanel { > private void updateMonths() { > if (monthPanel != null) { > Calendar tmpcal = cdt.getCalendarInstance(); >+ /* >+ * : Bug 288164 use first day of month to get February if currently selected date is higher than 29th >+ */ >+ tmpcal.set(Calendar.DAY_OF_MONTH, 1); > for (int i = 0; i < 12; i++) { > tmpcal.set(Calendar.MONTH, i); > monthButtons[i].setText(getFormattedDate( >-- >2.9.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 288164
: 263966