Skip to content

Commit b6e0baa

Browse files
committed
fix: correct hours distribution bucket boundaries to include 50-59 and 50+ ranges
1 parent 99f8029 commit b6e0baa

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/helpers/overviewReportHelper.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,7 +1357,8 @@ const overviewReportHelper = function () {
13571357
if (weeklyAverage <= 20) return '20';
13581358
if (weeklyAverage <= 30) return '30';
13591359
if (weeklyAverage <= 40) return '40';
1360-
return '40+';
1360+
if (weeklyAverage <= 50) return '50';
1361+
return '50+';
13611362
}
13621363

13631364
/**
@@ -1367,7 +1368,7 @@ const overviewReportHelper = function () {
13671368
* - Week is Sunday to Saturday
13681369
* - Count week only if 4+ days in range (exception: current week always counts)
13691370
* - Round user's average to upper bucket limit
1370-
* - Buckets: 10, 20, 30, 40, 40+
1371+
* - Buckets: 10, 20, 30, 40, 50, 50+
13711372
*/
13721373
async function getHoursStats(startDate, endDate, comparisonStartDate, comparisonEndDate) {
13731374
// Validate date parameters
@@ -1473,7 +1474,8 @@ const overviewReportHelper = function () {
14731474
20: 0,
14741475
30: 0,
14751476
40: 0,
1476-
'40+': 0,
1477+
50: 0,
1478+
'50+': 0,
14771479
};
14781480

14791481
for (const bucket of userBuckets) {
@@ -1486,7 +1488,8 @@ const overviewReportHelper = function () {
14861488
{ _id: '20', count: bucketCounts['20'] },
14871489
{ _id: '30', count: bucketCounts['30'] },
14881490
{ _id: '40', count: bucketCounts['40'] },
1489-
{ _id: '40+', count: bucketCounts['40+'] },
1491+
{ _id: '50', count: bucketCounts['50'] },
1492+
{ _id: '50+', count: bucketCounts['50+'] },
14901493
];
14911494

14921495
return hoursStats;

0 commit comments

Comments
 (0)