Within an array of objects, each object contains a field named "duration" that represents a string. Here is an example of one such object:
{
id: 14070
project: {id: 87, name: "Test project for time tracking"}
issue: {id: 10940}
user: {id: 107, name: "Alexander Kirillov"}
activity: {id: 9, name: "Development"}
hours: 0.01
comments: "RARA"
spent_on: "2020-03-23"
created_on: "2020-03-23T14:58:18Z"
updated_on: "2020-03-23T14:58:26Z"
custom_fields: (2) [{…}, {…}]
start: "Mon, 23rd Mar"
duration: "00:01" // HH:mm
__proto__: Object
}
The array containing these objects is named timeEntries = [{},{},...]; I am looking to calculate the total sum of all durations within the timeEntries objects using moment js. Any guidance would be greatly appreciated! Thank you in advance.