选日期的时候提取相邻的日期天数?


checkList:[
                    {
                        date:'2019-01-01',
                        num:1,
                        roomId:1
                    },
                    {
                        date:'2019-01-02',
                        num:1,
                        roomId:1
                    },
                    {
                        date:'2019-01-03',
                        num:1,
                        roomId:1
                    },
                    {
                        date:'2019-01-05',
                        num:1,
                        roomId:1
                    },
                    {
                        date:'2019-01-03',
                        num:1,
                        roomId:2
                    },
                    {
                        date:'2019-01-04',
                        num:1,
                        roomId:2
                    }
                ],
                checkList2:[
                    {
                        date:'2019-01-01',
                        num:3,
                        roomId:1
                    },
                    {
                        date:'2019-01-05',
                        num:1,
                        roomId:1
                    },
                    {
                        date:'2019-01-03',
                        num:2,
                        roomId:2
                    }
                ]
最终我想把list这个初始数据变成list2这样的数据要怎么弄,num是天数,roomId是房间idhttp://img2.mukewang.com/5e0b195300012be904570693.jpg

qq_浅仓小星_0
浏览 902回答 2
2回答
打开App,查看更多内容
随时随地看视频慕课网APP