My current json data is disordered and needs to be converted into a better format resembling the "expected" JSON object. The months are not in order which makes it difficult to filter out accordingly in the DOM. I require a complete reordering of the data like this: 2015-01, 2015-02, 2015-03...
Var myJson = [{"month":"2015-03", "name":"sg"},
{"month":"2015-03", "name":"pi"},
{"month":"2015-06", "name":"sg"},
{"month":"2015-06", "name":"pi"},
{"month":"2015-01", "name":"sg"},
{"month":"2015-01", "name":"pi"},
{"month":"2015-02", "name":"sg"},
{"month":"2015-02", "name":"pi"}
];
var expected = [{"month":"2015-01", "name":"sg"},
{"month":"2015-01", "name":"pi"},
{"month":"2015-02", "name":"sg"},
{"month":"2015-02", "name":"pi"},
{"month":"2015-03", "name":"sg"},
{"month":"2015-03", "name":"pi"},
{"month":"2015-06", "name":"sg"},
{"month":"2015-06", "name":"pi"}
];