从给定的数组输入创建arraylist

时间:2017-03-05 16:47:45

标签: javascript arrays

这里是数组数据

 {"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的专家......请提出任何建议......

1 个答案:

答案 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,我们