console
let arrs = [{
"id": 341,
"user_id": 2,
"title": "测试",
"content": "测试<img src=\"http://sharemeite.oss-cn-shanghai.aliyuncs.com/image/202002/91d2e95377657a57b99a8065029dbdcd.jpg\"/>",
"url_json": [
"http://sharemeite.oss-cn-shanghai.aliyuncs.com/image/202002/91d2e95377657a57b99a8065029dbdcd.jpg"
],
"created_at": "2020-02-11 14:42:51",
"status": 3,
"type": 3,
"nick_name": "聚仙人"
}, {
"id": 340,
"user_id": 2,
"title": "测试",
"content": "测试",
"url_json": [],
"created_at": "2020-02-11 14:37:14",
"status": 3,
"type": 3,
"nick_name": "聚仙人"
}, {
"id": 339,
"user_id": 2,
"title": "测试",
"content": "测试",
"url_json": [],
"created_at": "2020-01-11 14:35:40",
"status": 3,
"type": 3,
"nick_name": "聚仙人"
}, {
"id": 338,
"user_id": 2,
"title": "测试",
"content": "测试<img src=\"http://sharemeite.oss-cn-shanghai.aliyuncs.com/image/202002/5d65272f1c69624f4a1def89cff3e67f.jpg\"/><img src=\"http://sharemeite.oss-cn-shanghai.aliyuncs.com/image/202002/0c8041127cbfda0ba0a1d25c3b4c1720.jpg\"/><img src=\"http://sharemeite.oss-cn-shanghai.aliyuncs.com/image/202002/91d2e95377657a57b99a8065029dbdcd.jpg\"/>",
"url_json": [
"http://sharemeite.oss-cn-shanghai.aliyuncs.com/image/202002/5d65272f1c69624f4a1def89cff3e67f.jpg",
"http://sharemeite.oss-cn-shanghai.aliyuncs.com/image/202002/0c8041127cbfda0ba0a1d25c3b4c1720.jpg",
"http://sharemeite.oss-cn-shanghai.aliyuncs.com/image/202002/91d2e95377657a57b99a8065029dbdcd.jpg"
],
"created_at": "2020-02-09 20:21:46",
"status": 3,
"type": 3,
"nick_name": "聚仙人"
}, {
"id": 337,
"user_id": 2,
"title": "测试",
"content": "<img src=\"http://sharemeite.oss-cn-shanghai.aliyuncs.com/image/202002/4b792249293017799d3894f032e01de5.jpg\"/><img src=\"http://sharemeite.oss-cn-shanghai.aliyuncs.com/image/202002/45502c4ed257c2975813b602588a1788.jpg\"/><img src=\"http://sharemeite.oss-cn-shanghai.aliyuncs.com/image/202002/3d93e06abd52f0dc6aeb56c5074b5803.jpg\"/>",
"url_json": [],
"created_at": "2020-03-09 20:17:31",
"status": 3,
"type": 3,
"nick_name": "聚仙人"
}, {
"id": 336,
"user_id": 2,
"title": "测试机",
"content": "<img src=\"http://sharemeite.oss-cn-shanghai.aliyuncs.com/image/202002/4b792249293017799d3894f032e01de5.jpg\"/>",
"url_json": [],
"created_at": "2020-04-09 20:16:08",
"status": 3,
"type": 3,
"nick_name": "聚仙人"
}, {
"id": 335,
"user_id": 2,
"title": "测试机",
"content": "<img src=\"http://sharemeite.oss-cn-shanghai.aliyuncs.com/image/202002/91d2e95377657a57b99a8065029dbdcd.jpg\"/>",
"url_json": [],
"created_at": "2020-06-09 20:14:48",
"status": 3,
"type": 3,
"nick_name": "聚仙人"
}, {
"id": 334,
"user_id": 2,
"title": "测试",
"content": "阿杜咯哈<img src=\"http://sharemeite.oss-cn-shanghai.aliyuncs.com/image/202002/5d65272f1c69624f4a1def89cff3e67f.jpg\"/>",
"url_json": [],
"created_at": "2010-02-09 20:13:47",
"status": 3,
"type": 3,
"nick_name": "聚仙人"
}, {
"id": 333,
"user_id": 2,
"title": "",
"content": "CF雷神",
"url_json": [
"http://sharemeite.oss-cn-shanghai.aliyuncs.com/image/202002/4542bfe44d360aee45e56c69647e127a.jpg",
"http://sharemeite.oss-cn-shanghai.aliyuncs.com/image/202002/0c8041127cbfda0ba0a1d25c3b4c1720.jpg"
],
"created_at": "2011-02-09 20:07:59",
"status": 3,
"type": 1,
"nick_name": "聚仙人"
}, {
"id": 332,
"user_id": 2,
"title": "测试",
"content": "测试测试<img src=\"null\"/>",
"url_json": [],
"created_at": "2013-02-09 19:52:02",
"status": 3,
"type": 3,
"nick_name": "聚仙人"
}, {
"id": 331,
"user_id": 2,
"title": "测试",
"content": "测试测试<img src=\"null\"/><img src=\"null\"/>",
"url_json": [],
"created_at": "2020-02-09 19:42:23",
"status": 3,
"type": 3,
"nick_name": "聚仙人"
}, {
"id": 330,
"user_id": 2,
"title": "测试",
"content": "测试测试<img src=\"null\"/>",
"url_json": [],
"created_at": "2015-02-09 19:41:48",
"status": 3,
"type": 3,
"nick_name": "聚仙人"
}, {
"id": 324,
"user_id": 2,
"title": "",
"content": "测试测试#王者荣耀#测试测试",
"url_json": [
"http://sharemeite.oss-cn-shanghai.aliyuncs.com/image/202002/4542bfe44d360aee45e56c69647e127a.jpg"
],
"created_at": "2020-02-06 09:49:51",
"status": 3,
"type": 1,
"nick_name": "聚仙人"
}, {
"id": 322,
"user_id": 2,
"title": "",
"content": "我看了看来咯来咯咯莫#2#了他咯姐姐LOL了",
"url_json": [
"http://sharemeite.oss-cn-shanghai.aliyuncs.com/image/202002/0c8041127cbfda0ba0a1d25c3b4c1720.jpg"
],
"created_at": "2020-02-05 23:18:58",
"status": 3,
"type": 1,
"nick_name": "聚仙人"
}, {
"id": 321,
"user_id": 2,
"title": "测试",
"content": "木木嘟嘟欧布特特<img src=\"null\"/>乐乐獭兔嘟嘟嘟DJ错了特偷渡不饿卡特塔头搓揉啊塔楼吉普顿头儿偷渡额不扯头部斧头多特<img src=\"null\"/>",
"url_json": [],
"created_at": "2020-02-05 15:10:09",
"status": 3,
"type": 3,
"nick_name": "聚仙人"
}, {
"id": 320,
"user_id": 2,
"title": "测试",
"content": "垃圾了将计就计咯哦统计局乐途嘟嘟木渎TM嘟嘟补补多特唐巨疼服不服饿不<img src=\"null\"/>杜多特塔图姆夺目欧特他特特特头嘟嘟嘟他特特特他特偷渡福上来不不凑哦<img src=\"null\"/>不夸投啊徒步麻雀特特痛苦不短途土不土凑不",
"url_json": [],
"created_at": "2020-02-05 15:09:13",
"status": 3,
"type": 3,
"nick_name": "聚仙人"
}, {
"id": 318,
"user_id": 2,
"title": "测试",
"content": "测试<img src=\"http://sharemeite.oss-cn-shanghai.aliyuncs.com/image/202002/2fe3276cd7e38017705e4406fc8a497c.jpg\"/>",
"url_json": [],
"created_at": "2020-02-05 10:02:27",
"status": 3,
"type": 3,
"nick_name": "聚仙人"
}, {
"id": 317,
"user_id": 2,
"title": "测试",
"content": "测试<img src=\"http://sharemeite.oss-cn-shanghai.aliyuncs.com/image/202002/86a6b9978306c954f5181e030064dc08.jpg\"/>",
"url_json": [],
"created_at": "2020-02-05 09:57:05",
"status": 3,
"type": 3,
"nick_name": "聚仙人"
}, {
"id": 316,
"user_id": 2,
"title": "测试",
"content": "测试<img src=\"null\"/>",
"url_json": [],
"created_at": "2020-02-05 09:46:32",
"status": 3,
"type": 3,
"nick_name": "聚仙人"
}, {
"id": 315,
"user_id": 2,
"title": "测试",
"content": "测试<img src=\"null\"/>睡觉觉了拒绝咯了咯了萝莉控哦空间咯监控来咯来咯咯莫了咯了来了来了咳咳咳啦啦啦啦",
"url_json": [],
"created_at": "2020-02-05 09:44:55",
"status": 3,
"type": 3,
"nick_name": "聚仙人"
}]
console.log(arrs)
改成 年月、日来分组
比如
<script>
var aryy = [{
yearMonth: "2020年02月",
arr: [{
day: "03日",
arr: [{
"id": 341,
"user_id": 2,
"title": "把整个一条数组都放这个子数组里面",
},
{
"id": 341,
"user_id": 2,
"title": "测试",
},
]
},
{
day: "05日",
arr: [{
"id": 341,
"user_id": 2,
"title": "把整个数据都放这个子数组里面",
},
{
"id": 341,
"user_id": 2,
"title": "测试",
},
]
}
]
}, {
yearMonth: "2020年03月",
arr: [{
day: "13日",
arr: [{
"id": 341,
"user_id": 2,
"title": "把整个数据都放这个子数组里面",
},
{
"id": 341,
"user_id": 2,
"title": "测试",
},
]
},
{
day: "15日",
arr: [{
"id": 341,
"user_id": 2,
"title": "把整个数据都放这个子数组里面",
},
{
"id": 341,
"user_id": 2,
"title": "测试",
},
]
}
]
}]
</script>