/**
* author ;sfy
* 根據傳入的 年份 月分, 及開始 日期
* 計算 傳入月份還剩 哪些天
*
* @param year
* @param month
* @param today
* @return
*/
public static List<String> getAllDayByMonth(int year, int month, int today) {
SimpleDateFormat dateFormatYYYYMMDD = new SimpleDateFormat("MM月dd日");
List<String> fullDayList = new ArrayList<>(32);
// 獲得當前日期對象
Calendar cal = Calendar.getInstance();
cal.clear();// 清除信息
cal.set(Calendar.YEAR, year);
// 1月從0開始
cal.set(Calendar.MONTH, month - 1);
// 當月當前天
cal.set(Calendar.DAY_OF_MONTH, today);
int count = 0;
count = cal.getActualMaximum(Calendar.DAY_OF_MONTH) - today + 1;
for (int j = 1; j <= count; j++) {
fullDayList.add(dateFormatYYYYMMDD.format(cal.getTime()));
cal.add(Calendar.DAY_OF_MONTH, 1);
}
return fullDayList;
}