|
@@ -1299,13 +1299,16 @@ public class DateUtil {
|
|
|
List<String> monthList = new ArrayList<>();
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.setTime(startDate);
|
|
|
- while (!calendar.getTime().after(endDate)) {
|
|
|
+
|
|
|
+ while (calendar.getTime().compareTo(endDate) <= 0) { // 包含endDate所在的月份
|
|
|
monthList.add(DateUtil.format(calendar.getTime(), "yyyy-MM"));
|
|
|
calendar.add(Calendar.MONTH, 1);
|
|
|
}
|
|
|
+
|
|
|
return monthList;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
public static List<String> getYearList(Date startDate, Date endDate) {
|
|
|
List<String> yearList = new ArrayList<>();
|
|
|
Calendar calendar = Calendar.getInstance();
|