1 | if (minDate != null) {↵ | | 1 | if (maxDate != null) {↵
|
2 | int y = selectedDate.get(Calendar.YEAR);↵ | | 2 | int y = selectedDate.get(Calendar.YEAR);↵
|
3 | int y0 = minDate.get(Calendar.YEAR);↵ | | 3 | int y1 = maxDate.get(Calendar.YEAR);↵
|
4 | int m = selectedDate.get(Calendar.MONTH);↵ | | 4 | int m = selectedDate.get(Calendar.MONTH);↵
|
5 | int m0 = minDate.get(Calendar.MONTH);↵ | | 5 | int m1 = maxDate.get(Calendar.MONTH);↵
|
|
6 | // b_lyear.setEnabled(y > y0);↵ | | 6 | // b_ryear.setEnabled(y < y1);↵
|
7 | if (y == y0) {↵ | | 7 | if (y == y1) {↵
|
8 | b_lmonth.setEnabled(m > m0);↵ | | 8 | b_rmonth.setEnabled(m < m1);↵
|
|
9 | if (m == m0) {↵ | | 9 | if (m == m1) {↵
|
10 | clipMin = true;↵ | | 10 | clipMax = true;↵
|
|
11 | int d0 = minDate.get(Calendar.DATE);↵ | | 11 | int d1 = maxDate.get(Calendar.DATE);↵
|
|
12 | if (selectedDay < d0) {↵ | | 12 | if (selectedDay > d1) {↵
|
13 | selectedDate.set(Calendar.DATE, selectedDay = d0);↵ | | 13 | selectedDate.set(Calendar.DATE, selectedDay = d1);↵
|
14 | }↵ | | 14 | }↵
|
|
15 | // allow out-of-range selection↵ | | 15 | // allow out-of-range selection↵
|
16 | // selectedDate.set(Calendar.DATE, selectedDay);↵ | | 16 | // selectedDate.set(Calendar.DATE, selectedDay);↵
|
17 | }↵ | | 17 | }↵
|
18 | }↵ | | 18 | }↵
|
|
19 | clipAllMin = ((m < m0) || (y < y0));↵ | | 19 | clipAllMax = ((m > m1) || (y > y1));↵
|
20 | } | | 20 | }
|