* Returns an object componsed by dates and statuses. Dates is an array with dates used as input and the statuses is an array of a dictionary that is has as key the name of the status and the value if the number of occurences
* @param {*} parcels
* @param {*} dates
*/
exportfunctiongetStatuses(parcels,dates){
conststatuses=[];
dates.map((date)=>{
statuses.push({});
returnparcels.forEach((parcel)=>{
conststatus=getStatusByDate(parcel,date);
statuses[statuses.length-1][status]
?(statuses[statuses.length-1][status]=
statuses[statuses.length-1][status]+1)
:(statuses[statuses.length-1][status]=1);
});
});
return{
dates,
statuses,
};
}
exportfunctiongetItemsCount(parcels){
constcount=parcels.map((p)=>{
returnp.items.length;
...
...
@@ -7,16 +44,31 @@ export function getItemsCount(parcels) {