I have an array which look like this and its working fine but I need to arrange them groupwise like DateWise:
[
{
name: 'Ali',
startedAt: Wed Dec 28 2016 15:32:07 GMT+0500 (Pakistan Standard Time),
userId: '0002'
},
{
completedAt: Wed Dec 28 2016 12:51:47 GMT+0500 (Pakistan Standard Time),
name: 'Aliy',
startedAt: Wed Dec 28 2016 12:43:19 GMT+0500 (Pakistan Standard Time),
userId: '212'
},
{
name: 'Aliy',
startedAt: Wed Dec 28 2016 12:43:06 GMT+0500 (Pakistan Standard Time),
userId: '2121'
}
]
I have a code which groups them on the basis of startedAt
and it's working fine but the problem is that i want only date part like 28/12/2016.
The below code is used for grouping :
var groupedData = _.groupBy(data, function(d) {
return d.startedAt;
});
}
). Which is an excellent advertisement for why putting the closing}
on the same line as the last statement of a block is an awkward and error-prone bracing style. – Lobby