Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Obtaining values from variable and display as the javascript object file

var obj={"field_event_time": [
{
"value": "2018-12-23T00:00:00",
"rrule": "RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=SU;BYMONTH=3;BYMONTHDAY=4;UNTIL=20191230T055959Z;WKST=SU\r\nEXDATE:20181230T060000Z,20190113T060000Z\r\nRDATE:20190220T060000Z,20190520T050000Z",
"timezone": "America/Chicago",
"timezone_db": "America/Chicago",
"date_type": "date"
},
{
"value": "2019-02-20T00:00:00",
"rrule": "RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=SU;BYMONTH=3;BYMONTHDAY=4;UNTIL=20191230T055959Z;WKST=SU\r\nEXDATE:20181230T060000Z,20190113T060000Z\r\nRDATE:20190220T060000Z,20190520T050000Z",
"timezone": "America/Chicago",
"timezone_db": "America/Chicago",
"date_type": "date"
},
{
"value": "2019-05-20T00:00:00",
"rrule": "RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=SU;BYMONTH=3;BYMONTHDAY=4;UNTIL=20191230T055959Z;WKST=SU\r\nEXDATE:20181230T060000Z,20190113T060000Z\r\nRDATE:20190220T060000Z,20190520T050000Z",
"timezone": "America/Chicago",
"timezone_db": "America/Chicago",
"date_type": "date"
}
]
}

I want the javascript objects from 1st one and i want the output as the below format.

"field_event_time":{
                                       "value":{
                                           "date":"MM/DD/YYYY"
                                       },
                                       "rrule":{
                                           INTERVAL:"x",
                                           FREQ:"WEEKLY",
                                           UNTIL:{
                                               datetime:{
                                                   date:"MM/DD/YYYY"
                                               }
                                           },
                                           advanced:{
                                               BYDAY:["SU"]
                                           }
                                       }
                                   }

And output for the variable will look like:

"field_event_time":{ "value":{ "date":"12/23/2018" }, "rrule":{ INTERVAL:"1", FREQ:"WEEKLY", UNTIL:{ datetime:{ date:"12/29/2019" } }, advanced:{ BYDAY:["SU"] } } }

Comments