|
Lines 709-716
class DatePicker extends VPanel {
Link Here
|
| 709 |
} |
709 |
} |
| 710 |
|
710 |
|
| 711 |
Calendar tmpcal = cdt.getCalendarInstance(); |
711 |
Calendar tmpcal = cdt.getCalendarInstance(); |
| 712 |
tmpcal.set(Calendar.MONTH, |
712 |
int tmpday = tmpcal.get(Calendar.DAY_OF_MONTH); |
| 713 |
(Integer) button.getData("Month")); //$NON-NLS-1$ |
713 |
Integer tmpmonth = (Integer) button.getData("Month"); //$NON-NLS-1$ |
|
|
714 |
/* |
| 715 |
* : Bug 288164 keep the selected month by setting the day of month |
| 716 |
* to the minimum of actual maximum and the selected date |
| 717 |
*/ |
| 718 |
tmpcal.set(tmpcal.get(Calendar.YEAR), tmpmonth, 1); |
| 719 |
if (tmpcal.getActualMaximum(Calendar.DAY_OF_MONTH)<tmpday) |
| 720 |
tmpday = tmpcal.getActualMaximum(Calendar.DAY_OF_MONTH); |
| 721 |
tmpcal.set(Calendar.DAY_OF_MONTH, tmpday); |
| 722 |
tmpcal.set(Calendar.MONTH, tmpmonth); |
| 714 |
cdt.setSelection(tmpcal.getTime()); |
723 |
cdt.setSelection(tmpcal.getTime()); |
| 715 |
/* |
724 |
/* |
| 716 |
* : Bug 388813 the method cdt.isClosingField checks the |
725 |
* : Bug 388813 the method cdt.isClosingField checks the |
|
Lines 1398-1403
class DatePicker extends VPanel {
Link Here
|
| 1398 |
private void updateMonths() { |
1407 |
private void updateMonths() { |
| 1399 |
if (monthPanel != null) { |
1408 |
if (monthPanel != null) { |
| 1400 |
Calendar tmpcal = cdt.getCalendarInstance(); |
1409 |
Calendar tmpcal = cdt.getCalendarInstance(); |
|
|
1410 |
/* |
| 1411 |
* : Bug 288164 use first day of month to get February if currently selected date is higher than 29th |
| 1412 |
*/ |
| 1413 |
tmpcal.set(Calendar.DAY_OF_MONTH, 1); |
| 1401 |
for (int i = 0; i < 12; i++) { |
1414 |
for (int i = 0; i < 12; i++) { |
| 1402 |
tmpcal.set(Calendar.MONTH, i); |
1415 |
tmpcal.set(Calendar.MONTH, i); |
| 1403 |
monthButtons[i].setText(getFormattedDate( |
1416 |
monthButtons[i].setText(getFormattedDate( |
| 1404 |
- |
|
|