I have an something like this
{
1489330777089: 100, // 12 March
1489330824346: 45, // 12 March
1489330877089: 90, // 13 March
1489330824346: 120, // 13 March
.....
}
the key is from Date.now()
as they are created, and the value is an integer.
I want to plot these data into charts, like a bar graph with Dates as x-axis.
How do I use Javascript to group these data into dates, with the integer value summed up together. Expected result to be:
{
12 March 2017: 145 // 100 + 45
13 March 2017: 210 // 90 + 120
...
}
(I'm using this inside React app, if that's important to note. Also, using Firebase to store data)
Thanks!