根据会议预定记录(一维数组)制作会议预定表
已知会议室列表:
['201', '302', '403']
已知每天四个固定时间段:
['9-11', '11-14', '14-16', '16-18']
已知最近三天(不含周末)的会议预定记录:
[
{ date: '2020-06-29', time: '9-11', room: '201', unit: 'my company 1' },
{ date: '2020-06-30', time: '11-14', room: '302', unit: 'my company 2' }
]
要求是生成最近三天(不含周末)的会议预定表,格式如下:
[
{
"date":"2020-06-29",
"week":"周一",
"rooms":[
{
"name":"201",
"meetings":[
{
"time":"9-11",
"unit":"my company 1"
},
{
"time":"11-14",
"unit":""
},
{
"time":"14-16",
"unit":""
},
{
"time":"16-18",
"unit":""
}
]
},
{
"name":"302",
"meetings":[
{
"time":"9-11",
"unit":""
},
{
"time":"11-14",
"unit":"my company 2"
},
{
"time":"14-16",
"unit":""
},
{
"time":"16-18",
"unit":""
}
]
},
{
"name":"403",
"meetings":[
{
"time":"9-11",
"unit":""
},
{
"time":"11-14",
"unit":""
},
{
"time":"14-16",
"unit":""
},
{
"time":"16-18",
"unit":""
}
]
}
]
},
{// 此处是2020-06-30的数据,格式同上},
{// 此处是2020-07-01的数据,格式同上}
]