Calendar:获取每年每月的最后一天

时间:2021-01-02 08:04:53
@RequestMapping("/show/show001Cover.do")
	public void show001Cover(Integer year,Integer month,Boolean isCreate,String createDateStr,Model model){
		if(year!=null&&month!=null){
			Calendar calendar = Calendar.getInstance();
			calendar.set(year, month-1, 1);
			int day = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
			model.addAttribute("year",year);
			model.addAttribute("month",month);
			model.addAttribute("day",day);
		}
		model.addAttribute("createDateStr",createDateStr);
		model.addAttribute("isCreate",isCreate);
	}