JAVA 获取一段时间内日期 每一天的所属年,所属月,所属周 并生成结构化的map (注:统一以比较日期所在周的周三获取,年、月、周)

原创  郑建华   2020-01-09   183人阅读  0 条评论

image.png

    现需要,获取一年内的全部日期,并且以上图的方式生成表格。表格内容包括,月、周,并且鼠标移动到每周的格子中时,需要高亮显示竖线,并且显示日期。以每周的周三为准,确定日期的所属周和所属月。比如2020年1月,第五周的周三属于第五周,第五周的周三属于1月。

image.png

    实现思路:

    结构化的数据是需要循环生成map的,循环的前提是有个集合来进行遍历。而已有的条件只有一个开始时间和结束时间,需要先根据两个时间生成一个可用于遍历的拥有完整数据的集合。

    1、根据开始时间,结束时间,递归调用。从开始时间开始,获取当前时间所在周的周三的所属年,所属月,所属周等属性,放入集合中。再将日期增加一天,直到日期与结束时间相等结束递归调用,生成一个完整数据的List集合。

    2、由于时间段可能跨年,所以先遍历数据,根据年份拆分,生成年份map,每个年份一个List集合。

    3、遍历年份map,再遍历年份map的list集合,根据月份拆分,生成月份map,每个月份一个List集合。

    4、遍历月份map,再遍历月份map的list集合,根据周拆分,生成周map,每个周一个List集合。

    5、在遍历的过程中,将周map嵌套到月份map2中。

    6、在遍历的过程中,将月份map2嵌套到年份map2中。

    7、返回年份map2为最终结果


代码:(其中的日期处理工具类,参考《JAVA 时间日期工具方法收藏 持续更新》的工具类一)

	/**
	 * 
	 * <p>根据开始日期,结束日期,获取当前时间段内的日期List结构
	 * 最外层List表示月
	 * 第二层List表示周
	 * 第三层List表示日
	 * @param starttime
	 * @param endtime
	 * @return 
	 * @return List<List<List<Map<String,Object>>>>    
	 * author: zhengjianhua
	 */
	public static Map<String,Object> getDateList(String starttime,String endtime){
		
		//从开始日期开始遍历,加一天比较是否是结束日期,不是则继续,是则结束遍历 获取List日期map
		List<Map<String,Object>> dayList=circulationDate(starttime, endtime, null);

		//遍历list生成结构化数据
	
		//年份map数据
		Map<String,List<Map<String,Object>>> yearMap=new HashMap<String,List<Map<String,Object>>>();		
		
		//年份map2 用于接收处理后的数据
		Map<String,Object> yearMap2=new HashMap<String,Object>();
				
		//1、先根据年份拆分
		if(CollectionUtils.isNotEmpty(dayList)){
			for (Map<String, Object> map : dayList) {
				//年份
				String year=map.get("year")==null?"":String.valueOf(map.get("year"));
				//是否包含年份map
				if(yearMap.containsKey(year)){
					//年份map的元素
					List<Map<String,Object>> tempList=yearMap.get(year);
					//添加到集合中
					tempList.add(map);
				}else{
					//创建list
					List<Map<String,Object>> tempList=new ArrayList<Map<String,Object>>();
					//添加到集合中
					tempList.add(map);
					//添加到map中
					yearMap.put(year, tempList);
				}
			}
		}
		
		//2、遍历年份map 根据月份拆分
		if(MapUtils.isNotEmpty(yearMap)){
			//遍历键值对
			for(Entry<String, List<Map<String, Object>>> entry:yearMap.entrySet()){
				//当前年份的dayList集合
				List<Map<String,Object>> yearDayList=entry.getValue();
				
				//月份map数据
				Map<String,List<Map<String,Object>>> monthMap=new HashMap<String,List<Map<String,Object>>>();		
				
				//月份map数据2 用于接收处理后的数据
				Map<String,Object> monthMap2=new HashMap<String,Object>();
				
				if(CollectionUtils.isNotEmpty(yearDayList)){
					for (Map<String, Object> map : yearDayList) {
						//月份
						String month=map.get("month")==null?"":String.valueOf(map.get("month"));
						//是否包含月份map
						if(monthMap.containsKey(month)){
							//月份map的元素
							List<Map<String,Object>> tempList=monthMap.get(month);
							//添加到集合中
							tempList.add(map);
						}else{
							//创建list
							List<Map<String,Object>> tempList=new ArrayList<Map<String,Object>>();
							//添加到集合中
							tempList.add(map);
							//添加到map中
							monthMap.put(month, tempList);
						}
					}
				}
				
				
				//3、遍历月份map
				if(MapUtils.isNotEmpty(monthMap)){
					//遍历键值对
					for(Entry<String, List<Map<String, Object>>> entry1:monthMap.entrySet()){
						//周map数据
						Map<String,List<Map<String,Object>>> weekMap=new HashMap<String,List<Map<String,Object>>>();		
						//当前月份的dayList集合
						List<Map<String,Object>> monthDayList=entry1.getValue();
						if(CollectionUtils.isNotEmpty(monthDayList)){
							for (Map<String, Object> map2 : monthDayList) {
								//周数
								String week=map2.get("week")==null?"":String.valueOf(map2.get("week"));
								//是否包含周map
								if(weekMap.containsKey(week)){
									//周map的元素
									List<Map<String,Object>> tempList=weekMap.get(week);
									//添加到集合中
									tempList.add(map2);
								}else{
									//创建list
									List<Map<String,Object>> tempList=new ArrayList<Map<String,Object>>();
									//添加到集合中
									tempList.add(map2);
									//添加到map中
									weekMap.put(week, tempList);
								}
							}
						}
						
						//月份map嵌套 周map
						monthMap2.put(entry1.getKey(), weekMap);
					}
				}
				
				//年份map 嵌套月份map
				yearMap2.put(entry.getKey(), monthMap2);
			}
		}
		
		return yearMap2;
	}
	
	
	public static List<Map<String,Object>> circulationDate(String starttime,String endtime,List<Map<String,Object>> dayList){
		Map<String,Object> dayMap=new HashMap<String,Object>();
		//开始日期
		Date starttimeDate=DateUtils.parse(starttime);
		 //获取当前日期所在周的周三 根据周三的日期 来判定是当年的第几周,几月,哪年
         Calendar cal = Calendar.getInstance();  
         cal.setTime(starttimeDate);  
         // 判断要计算的日期是否是周日,如果是则减一天计算周六的,否则会出问题,计算到下一周去了  
         int dayWeek = cal.get(Calendar.DAY_OF_WEEK);// 获得当前日期是一个星期的第几天  
         if (1 == dayWeek) {  
             cal.add(Calendar.DAY_OF_MONTH, -1);  
         }  
         cal.setMinimalDaysInFirstWeek(4);//设置一年内第一周至少需要多少天,设置4天,表示第一个周三算在第一周
         cal.setFirstDayOfWeek(Calendar.MONDAY);// 设置一个星期的第一天,按中国的习惯一个星期的第一天是星期一  
         int day = cal.get(Calendar.DAY_OF_WEEK);// 获得当前日期是一个星期的第几天  
         cal.add(Calendar.DATE, cal.getFirstDayOfWeek() - day);// 根据日历的规则,给当前日期减去星期几与一个星期第一天的差值  
         cal.add(Calendar.DATE, 2);//周三的日期
         int month=cal.get(Calendar.MONTH);//周三日期所属的月份
         int weekYear = cal.get(Calendar.YEAR);//获得当前的年
         int weekOfYear = cal.get(Calendar.WEEK_OF_YEAR);//获得当前日期属于今年的第几周
         
         
         //所属年
         dayMap.put("year", weekYear);
         //所属月
         dayMap.put("month", month+1);
		 //所属周
         dayMap.put("week", weekOfYear);
         //所属日期
         dayMap.put("day", starttime);
         if(CollectionUtils.isEmpty(dayList)){
        	 //创建集合
        	 dayList=new ArrayList<Map<String,Object>>();
         }
         //添加到集合中
    	 dayList.add(dayMap);
		//开始时间与结束时间不相等
		if(!starttime.equals(endtime)){
			
			 //开始日期加一天
			 String addOneDateString=DateUtils.getFormatDateAdd(starttimeDate, 1, DateUtils.DATE_YY_MM_DD);
			 //调用自身方法递归
			 dayList=circulationDate(addOneDateString, endtime,dayList);
		}
		return dayList;
	}

测试代码:

	public static void main(String[] args) {
		
		Map<String,Object> yearMap=getDateList("2019-12-01","2020-08-01");
		
		System.out.println(JSONObject.toJSON(yearMap));
	}

运行结果:

{"2019":{"11":{"48":[{"week":48,"month":11,"year":2019,"day":"2019-12-01"}]},"12":{"50":[{"week":50,"month":12,"year":2019,"day":"2019-12-09"},{"week":50,"month":12,"year":2019,"day":"2019-12-10"},{"week":50,"month":12,"year":2019,"day":"2019-12-11"},{"week":50,"month":12,"year":2019,"day":"2019-12-12"},{"week":50,"month":12,"year":2019,"day":"2019-12-13"},{"week":50,"month":12,"year":2019,"day":"2019-12-14"},{"week":50,"month":12,"year":2019,"day":"2019-12-15"}],"51":[{"week":51,"month":12,"year":2019,"day":"2019-12-16"},{"week":51,"month":12,"year":2019,"day":"2019-12-17"},{"week":51,"month":12,"year":2019,"day":"2019-12-18"},{"week":51,"month":12,"year":2019,"day":"2019-12-19"},{"week":51,"month":12,"year":2019,"day":"2019-12-20"},{"week":51,"month":12,"year":2019,"day":"2019-12-21"},{"week":51,"month":12,"year":2019,"day":"2019-12-22"}],"49":[{"week":49,"month":12,"year":2019,"day":"2019-12-02"},{"week":49,"month":12,"year":2019,"day":"2019-12-03"},{"week":49,"month":12,"year":2019,"day":"2019-12-04"},{"week":49,"month":12,"year":2019,"day":"2019-12-05"},{"week":49,"month":12,"year":2019,"day":"2019-12-06"},{"week":49,"month":12,"year":2019,"day":"2019-12-07"},{"week":49,"month":12,"year":2019,"day":"2019-12-08"}],"52":[{"week":52,"month":12,"year":2019,"day":"2019-12-23"},{"week":52,"month":12,"year":2019,"day":"2019-12-24"},{"week":52,"month":12,"year":2019,"day":"2019-12-25"},{"week":52,"month":12,"year":2019,"day":"2019-12-26"},{"week":52,"month":12,"year":2019,"day":"2019-12-27"},{"week":52,"month":12,"year":2019,"day":"2019-12-28"},{"week":52,"month":12,"year":2019,"day":"2019-12-29"}]}},"2020":{"1":{"1":[{"week":1,"month":1,"year":2020,"day":"2019-12-30"},{"week":1,"month":1,"year":2020,"day":"2019-12-31"},{"week":1,"month":1,"year":2020,"day":"2020-01-01"},{"week":1,"month":1,"year":2020,"day":"2020-01-02"},{"week":1,"month":1,"year":2020,"day":"2020-01-03"},{"week":1,"month":1,"year":2020,"day":"2020-01-04"},{"week":1,"month":1,"year":2020,"day":"2020-01-05"}],"2":[{"week":2,"month":1,"year":2020,"day":"2020-01-06"},{"week":2,"month":1,"year":2020,"day":"2020-01-07"},{"week":2,"month":1,"year":2020,"day":"2020-01-08"},{"week":2,"month":1,"year":2020,"day":"2020-01-09"},{"week":2,"month":1,"year":2020,"day":"2020-01-10"},{"week":2,"month":1,"year":2020,"day":"2020-01-11"},{"week":2,"month":1,"year":2020,"day":"2020-01-12"}],"3":[{"week":3,"month":1,"year":2020,"day":"2020-01-13"},{"week":3,"month":1,"year":2020,"day":"2020-01-14"},{"week":3,"month":1,"year":2020,"day":"2020-01-15"},{"week":3,"month":1,"year":2020,"day":"2020-01-16"},{"week":3,"month":1,"year":2020,"day":"2020-01-17"},{"week":3,"month":1,"year":2020,"day":"2020-01-18"},{"week":3,"month":1,"year":2020,"day":"2020-01-19"}],"4":[{"week":4,"month":1,"year":2020,"day":"2020-01-20"},{"week":4,"month":1,"year":2020,"day":"2020-01-21"},{"week":4,"month":1,"year":2020,"day":"2020-01-22"},{"week":4,"month":1,"year":2020,"day":"2020-01-23"},{"week":4,"month":1,"year":2020,"day":"2020-01-24"},{"week":4,"month":1,"year":2020,"day":"2020-01-25"},{"week":4,"month":1,"year":2020,"day":"2020-01-26"}],"5":[{"week":5,"month":1,"year":2020,"day":"2020-01-27"},{"week":5,"month":1,"year":2020,"day":"2020-01-28"},{"week":5,"month":1,"year":2020,"day":"2020-01-29"},{"week":5,"month":1,"year":2020,"day":"2020-01-30"},{"week":5,"month":1,"year":2020,"day":"2020-01-31"},{"week":5,"month":1,"year":2020,"day":"2020-02-01"},{"week":5,"month":1,"year":2020,"day":"2020-02-02"}]},"2":{"8":[{"week":8,"month":2,"year":2020,"day":"2020-02-17"},{"week":8,"month":2,"year":2020,"day":"2020-02-18"},{"week":8,"month":2,"year":2020,"day":"2020-02-19"},{"week":8,"month":2,"year":2020,"day":"2020-02-20"},{"week":8,"month":2,"year":2020,"day":"2020-02-21"},{"week":8,"month":2,"year":2020,"day":"2020-02-22"},{"week":8,"month":2,"year":2020,"day":"2020-02-23"}],"9":[{"week":9,"month":2,"year":2020,"day":"2020-02-24"},{"week":9,"month":2,"year":2020,"day":"2020-02-25"},{"week":9,"month":2,"year":2020,"day":"2020-02-26"},{"week":9,"month":2,"year":2020,"day":"2020-02-27"},{"week":9,"month":2,"year":2020,"day":"2020-02-28"},{"week":9,"month":2,"year":2020,"day":"2020-02-29"},{"week":9,"month":2,"year":2020,"day":"2020-03-01"}],"6":[{"week":6,"month":2,"year":2020,"day":"2020-02-03"},{"week":6,"month":2,"year":2020,"day":"2020-02-04"},{"week":6,"month":2,"year":2020,"day":"2020-02-05"},{"week":6,"month":2,"year":2020,"day":"2020-02-06"},{"week":6,"month":2,"year":2020,"day":"2020-02-07"},{"week":6,"month":2,"year":2020,"day":"2020-02-08"},{"week":6,"month":2,"year":2020,"day":"2020-02-09"}],"7":[{"week":7,"month":2,"year":2020,"day":"2020-02-10"},{"week":7,"month":2,"year":2020,"day":"2020-02-11"},{"week":7,"month":2,"year":2020,"day":"2020-02-12"},{"week":7,"month":2,"year":2020,"day":"2020-02-13"},{"week":7,"month":2,"year":2020,"day":"2020-02-14"},{"week":7,"month":2,"year":2020,"day":"2020-02-15"},{"week":7,"month":2,"year":2020,"day":"2020-02-16"}]},"3":{"11":[{"week":11,"month":3,"year":2020,"day":"2020-03-09"},{"week":11,"month":3,"year":2020,"day":"2020-03-10"},{"week":11,"month":3,"year":2020,"day":"2020-03-11"},{"week":11,"month":3,"year":2020,"day":"2020-03-12"},{"week":11,"month":3,"year":2020,"day":"2020-03-13"},{"week":11,"month":3,"year":2020,"day":"2020-03-14"},{"week":11,"month":3,"year":2020,"day":"2020-03-15"}],"12":[{"week":12,"month":3,"year":2020,"day":"2020-03-16"},{"week":12,"month":3,"year":2020,"day":"2020-03-17"},{"week":12,"month":3,"year":2020,"day":"2020-03-18"},{"week":12,"month":3,"year":2020,"day":"2020-03-19"},{"week":12,"month":3,"year":2020,"day":"2020-03-20"},{"week":12,"month":3,"year":2020,"day":"2020-03-21"},{"week":12,"month":3,"year":2020,"day":"2020-03-22"}],"13":[{"week":13,"month":3,"year":2020,"day":"2020-03-23"},{"week":13,"month":3,"year":2020,"day":"2020-03-24"},{"week":13,"month":3,"year":2020,"day":"2020-03-25"},{"week":13,"month":3,"year":2020,"day":"2020-03-26"},{"week":13,"month":3,"year":2020,"day":"2020-03-27"},{"week":13,"month":3,"year":2020,"day":"2020-03-28"},{"week":13,"month":3,"year":2020,"day":"2020-03-29"}],"10":[{"week":10,"month":3,"year":2020,"day":"2020-03-02"},{"week":10,"month":3,"year":2020,"day":"2020-03-03"},{"week":10,"month":3,"year":2020,"day":"2020-03-04"},{"week":10,"month":3,"year":2020,"day":"2020-03-05"},{"week":10,"month":3,"year":2020,"day":"2020-03-06"},{"week":10,"month":3,"year":2020,"day":"2020-03-07"},{"week":10,"month":3,"year":2020,"day":"2020-03-08"}]},"4":{"14":[{"week":14,"month":4,"year":2020,"day":"2020-03-30"},{"week":14,"month":4,"year":2020,"day":"2020-03-31"},{"week":14,"month":4,"year":2020,"day":"2020-04-01"},{"week":14,"month":4,"year":2020,"day":"2020-04-02"},{"week":14,"month":4,"year":2020,"day":"2020-04-03"},{"week":14,"month":4,"year":2020,"day":"2020-04-04"},{"week":14,"month":4,"year":2020,"day":"2020-04-05"}],"15":[{"week":15,"month":4,"year":2020,"day":"2020-04-06"},{"week":15,"month":4,"year":2020,"day":"2020-04-07"},{"week":15,"month":4,"year":2020,"day":"2020-04-08"},{"week":15,"month":4,"year":2020,"day":"2020-04-09"},{"week":15,"month":4,"year":2020,"day":"2020-04-10"},{"week":15,"month":4,"year":2020,"day":"2020-04-11"},{"week":15,"month":4,"year":2020,"day":"2020-04-12"}],"16":[{"week":16,"month":4,"year":2020,"day":"2020-04-13"},{"week":16,"month":4,"year":2020,"day":"2020-04-14"},{"week":16,"month":4,"year":2020,"day":"2020-04-15"},{"week":16,"month":4,"year":2020,"day":"2020-04-16"},{"week":16,"month":4,"year":2020,"day":"2020-04-17"},{"week":16,"month":4,"year":2020,"day":"2020-04-18"},{"week":16,"month":4,"year":2020,"day":"2020-04-19"}],"17":[{"week":17,"month":4,"year":2020,"day":"2020-04-20"},{"week":17,"month":4,"year":2020,"day":"2020-04-21"},{"week":17,"month":4,"year":2020,"day":"2020-04-22"},{"week":17,"month":4,"year":2020,"day":"2020-04-23"},{"week":17,"month":4,"year":2020,"day":"2020-04-24"},{"week":17,"month":4,"year":2020,"day":"2020-04-25"},{"week":17,"month":4,"year":2020,"day":"2020-04-26"}],"18":[{"week":18,"month":4,"year":2020,"day":"2020-04-27"},{"week":18,"month":4,"year":2020,"day":"2020-04-28"},{"week":18,"month":4,"year":2020,"day":"2020-04-29"},{"week":18,"month":4,"year":2020,"day":"2020-04-30"},{"week":18,"month":4,"year":2020,"day":"2020-05-01"},{"week":18,"month":4,"year":2020,"day":"2020-05-02"},{"week":18,"month":4,"year":2020,"day":"2020-05-03"}]},"5":{"22":[{"week":22,"month":5,"year":2020,"day":"2020-05-25"},{"week":22,"month":5,"year":2020,"day":"2020-05-26"},{"week":22,"month":5,"year":2020,"day":"2020-05-27"},{"week":22,"month":5,"year":2020,"day":"2020-05-28"},{"week":22,"month":5,"year":2020,"day":"2020-05-29"},{"week":22,"month":5,"year":2020,"day":"2020-05-30"},{"week":22,"month":5,"year":2020,"day":"2020-05-31"}],"19":[{"week":19,"month":5,"year":2020,"day":"2020-05-04"},{"week":19,"month":5,"year":2020,"day":"2020-05-05"},{"week":19,"month":5,"year":2020,"day":"2020-05-06"},{"week":19,"month":5,"year":2020,"day":"2020-05-07"},{"week":19,"month":5,"year":2020,"day":"2020-05-08"},{"week":19,"month":5,"year":2020,"day":"2020-05-09"},{"week":19,"month":5,"year":2020,"day":"2020-05-10"}],"20":[{"week":20,"month":5,"year":2020,"day":"2020-05-11"},{"week":20,"month":5,"year":2020,"day":"2020-05-12"},{"week":20,"month":5,"year":2020,"day":"2020-05-13"},{"week":20,"month":5,"year":2020,"day":"2020-05-14"},{"week":20,"month":5,"year":2020,"day":"2020-05-15"},{"week":20,"month":5,"year":2020,"day":"2020-05-16"},{"week":20,"month":5,"year":2020,"day":"2020-05-17"}],"21":[{"week":21,"month":5,"year":2020,"day":"2020-05-18"},{"week":21,"month":5,"year":2020,"day":"2020-05-19"},{"week":21,"month":5,"year":2020,"day":"2020-05-20"},{"week":21,"month":5,"year":2020,"day":"2020-05-21"},{"week":21,"month":5,"year":2020,"day":"2020-05-22"},{"week":21,"month":5,"year":2020,"day":"2020-05-23"},{"week":21,"month":5,"year":2020,"day":"2020-05-24"}]},"6":{"23":[{"week":23,"month":6,"year":2020,"day":"2020-06-01"},{"week":23,"month":6,"year":2020,"day":"2020-06-02"},{"week":23,"month":6,"year":2020,"day":"2020-06-03"},{"week":23,"month":6,"year":2020,"day":"2020-06-04"},{"week":23,"month":6,"year":2020,"day":"2020-06-05"},{"week":23,"month":6,"year":2020,"day":"2020-06-06"},{"week":23,"month":6,"year":2020,"day":"2020-06-07"}],"24":[{"week":24,"month":6,"year":2020,"day":"2020-06-08"},{"week":24,"month":6,"year":2020,"day":"2020-06-09"},{"week":24,"month":6,"year":2020,"day":"2020-06-10"},{"week":24,"month":6,"year":2020,"day":"2020-06-11"},{"week":24,"month":6,"year":2020,"day":"2020-06-12"},{"week":24,"month":6,"year":2020,"day":"2020-06-13"},{"week":24,"month":6,"year":2020,"day":"2020-06-14"}],"25":[{"week":25,"month":6,"year":2020,"day":"2020-06-15"},{"week":25,"month":6,"year":2020,"day":"2020-06-16"},{"week":25,"month":6,"year":2020,"day":"2020-06-17"},{"week":25,"month":6,"year":2020,"day":"2020-06-18"},{"week":25,"month":6,"year":2020,"day":"2020-06-19"},{"week":25,"month":6,"year":2020,"day":"2020-06-20"},{"week":25,"month":6,"year":2020,"day":"2020-06-21"}],"26":[{"week":26,"month":6,"year":2020,"day":"2020-06-22"},{"week":26,"month":6,"year":2020,"day":"2020-06-23"},{"week":26,"month":6,"year":2020,"day":"2020-06-24"},{"week":26,"month":6,"year":2020,"day":"2020-06-25"},{"week":26,"month":6,"year":2020,"day":"2020-06-26"},{"week":26,"month":6,"year":2020,"day":"2020-06-27"},{"week":26,"month":6,"year":2020,"day":"2020-06-28"}]},"7":{"27":[{"week":27,"month":7,"year":2020,"day":"2020-06-29"},{"week":27,"month":7,"year":2020,"day":"2020-06-30"},{"week":27,"month":7,"year":2020,"day":"2020-07-01"},{"week":27,"month":7,"year":2020,"day":"2020-07-02"},{"week":27,"month":7,"year":2020,"day":"2020-07-03"},{"week":27,"month":7,"year":2020,"day":"2020-07-04"},{"week":27,"month":7,"year":2020,"day":"2020-07-05"}],"30":[{"week":30,"month":7,"year":2020,"day":"2020-07-20"},{"week":30,"month":7,"year":2020,"day":"2020-07-21"},{"week":30,"month":7,"year":2020,"day":"2020-07-22"},{"week":30,"month":7,"year":2020,"day":"2020-07-23"},{"week":30,"month":7,"year":2020,"day":"2020-07-24"},{"week":30,"month":7,"year":2020,"day":"2020-07-25"},{"week":30,"month":7,"year":2020,"day":"2020-07-26"}],"28":[{"week":28,"month":7,"year":2020,"day":"2020-07-06"},{"week":28,"month":7,"year":2020,"day":"2020-07-07"},{"week":28,"month":7,"year":2020,"day":"2020-07-08"},{"week":28,"month":7,"year":2020,"day":"2020-07-09"},{"week":28,"month":7,"year":2020,"day":"2020-07-10"},{"week":28,"month":7,"year":2020,"day":"2020-07-11"},{"week":28,"month":7,"year":2020,"day":"2020-07-12"}],"31":[{"week":31,"month":7,"year":2020,"day":"2020-07-27"},{"week":31,"month":7,"year":2020,"day":"2020-07-28"},{"week":31,"month":7,"year":2020,"day":"2020-07-29"},{"week":31,"month":7,"year":2020,"day":"2020-07-30"},{"week":31,"month":7,"year":2020,"day":"2020-07-31"},{"week":31,"month":7,"year":2020,"day":"2020-08-01"}],"29":[{"week":29,"month":7,"year":2020,"day":"2020-07-13"},{"week":29,"month":7,"year":2020,"day":"2020-07-14"},{"week":29,"month":7,"year":2020,"day":"2020-07-15"},{"week":29,"month":7,"year":2020,"day":"2020-07-16"},{"week":29,"month":7,"year":2020,"day":"2020-07-17"},{"week":29,"month":7,"year":2020,"day":"2020-07-18"},{"week":29,"month":7,"year":2020,"day":"2020-07-19"}]}}}

格式化:

image.png

image.png

本文地址:https://www.zjh336.cn/?id=168
版权声明:本文为原创文章,版权归 郑建华 所有,欢迎分享本文,转载请保留出处!

发表评论


表情

还没有留言,还不快点抢沙发?