| | |
| | | } |
| | | |
| | | |
| | | public static List<Date> getDateList(Date dBegin, Date dEnd) { |
| | | int i = 1; |
| | | //日期工具类准备 |
| | | DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | //设置开始时间 |
| | | Calendar calBegin = Calendar.getInstance(); |
| | | calBegin.setTime(dBegin); |
| | | int weekNumber = calBegin.get(Calendar.DAY_OF_WEEK) - 1; |
| | | //设置结束时间 |
| | | Calendar calEnd = Calendar.getInstance(); |
| | | calEnd.setTime(dEnd); |
| | | //装返回的日期集合容器 |
| | | List<Date> dateList = new ArrayList<Date>(); |
| | | dateList.add(dBegin); |
| | | //将第一个月添加里面去 |
| | | while (dEnd.after(calBegin.getTime())) { |
| | | calBegin.add(Calendar.DAY_OF_MONTH, 1); |
| | | Date date = calBegin.getTime(); |
| | | dateList.add(date); |
| | | } |
| | | return dateList; |
| | | } |
| | | |
| | | |
| | | |
| | | public static Date StringToDateFormat(String DATE,String format) { |
| | | if(StringUtils.isBlank(DATE)){ |