My array is like this:
myArray = [
{date: "2017-01-01", num: "2"}
{date: "2017-01-02", num: "3"}
{date: "2017-02-04", num: "6"}
{date: "2017-02-05", num: "15"}
]
I want to convert this into:
myArray = [
{group: "0", data: [
{date: "2017-01-01", num: "2"}
{date: "2017-01-02", num: "3"}]
},
{group: "1", data: [
{date: "2017-02-04", num: "6"}
{date: "2017-02-05", num: "15"}]
},
]
Basically, group by month of date key.