How do build an array with minute counts per hour within a set date range.
Assuming you have these dates
const start = new Date('2019-04-04 12:14');
const end = new Date('2019-04-04 16:21');
How do you turn that into and array looking like this:
const minutes_per_hour = [
{
hour: 12,
minute_count: 46
},
{
hour: 13,
minute_count: 60
},
{
hour: 14,
minute_count: 60
},
{
hour: 15,
minute_count: 60
},
{
hour: 16,
minute_count: 21
}
];