/**
* 获取某一月份的所有日期
* date 年月;格式:"2018-10"
* @return
*/
public static List<String> getAllMonthDays(String date) {
int year = Integer.parseInt(date.substring(0, 4));
int month = Integer.parseInt(date.substring(5));
Calendar a = Calendar.getInstance();
a.set(Calendar.YEAR, year);
a.set(Calendar.MONTH, month - 1);
a.set(Calendar.DATE, 1);
a.roll(Calendar.DATE, -1);
int days = a.get(Calendar.DATE);
List<String> resultList = new ArrayList<String>();
for(int i=1;i<=days;i++) {
String day = null;
if(i<10) {
day = String.valueOf(year)+"-"+String.valueOf(month)+"-0"+String.valueOf(i);
}else {
day = String.valueOf(year)+"-"+String.valueOf(month)+"-"+String.valueOf(i);
}
resultList.add(day);
}
return resultList;
}