Skip to content

Commit b5dfdd9

Browse files
author
Irae Hueck Costa
committed
Fix dashboard date grouping logic for year display.
1 parent c4eac9e commit b5dfdd9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

static/js/dashboard.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -315,11 +315,13 @@ function dGroupDates(dates) {
315315
// if it's still to big, use months. 16 is a magic number to swap to the per month view
316316
if (Object.keys(groupedDates).length > 16) {
317317
groupedDates = groupedByMonth;
318+
// Use years if we are displaying more than 16 month.
319+
if (Object.keys(groupedDates).length > 16) {
320+
groupedDates = groupedByYear
321+
}
318322
}
319323
}
320324

321-
// groupedDates = groupedByYear;
322-
323325
return [Object.keys(groupedDates), Object.values(groupedDates)];
324326
}
325327

0 commit comments

Comments
 (0)