这里是数组数据
{"start":"20160530T164500",
"end":"20160530T173000",
"rule":"FREQ=WEEKLY;BYDAY=MO,WE",
"summary":"Meeting on Monday/wed"}
我必须阅读规则参数,并且基于白天,需要创建如下行
例如,它有MO,WE因此需要2个数组行,如下所示
{"day":"MO","start":"20160530T164500","end":"20160530T173000","rule":"FREQ=WEEKLY;BYDAY=MO,WE","summary":"Meeting on Monday/wed"}
{"day":"WE","start":"20160530T164500","end":"20160530T173000","rule":"FREQ=WEEKLY;BYDAY=MO,WE","summary":"Meeting on Monday/wed"}
javascript / array的专家......请提出任何建议......
答案 0 :(得分:1)
let data = {"start":"20160530T164500","end":"20160530T173000","rule":"FREQ=WEEKLY;BYDAY=MO,WE","summary":"Meeting on Monday/wed"};
let result = data['rule'];
let ans = result.split("=");
应该包含WEEKLY;BYDAY=MO,WE
每周一次;和BYDAY = MO,我们