UNPKG

nexus-react-core

Version:

A comprehensive React toolkit with services, hooks, and Redux store management

14 lines 546 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.groupDataByWeekdays = void 0; const groupDataByWeekdays = (data) => { const result = Array(7).fill(0); // Initialize array of 7 numbers with 0s data.forEach((item) => { const date = new Date(item.timestamp); const day = date.getUTCDay(); // 0 = Sunday, 1 = Monday, ..., 6 = Saturday result[day] += item.value; }); return result; }; exports.groupDataByWeekdays = groupDataByWeekdays; //# sourceMappingURL=infraUtils.js.map