Skip to content

Commit 6017647

Browse files
committed
fix(panel/playerDrops): fixed timeline window start calc
1 parent ad39a7d commit 6017647

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

panel/src/pages/PlayerDropsPage/TimelineCard.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,14 @@ const TimelineCard = memo(({
3838
const endDate = new Date(dataTs);
3939
if (displayLod === 'day') {
4040
// 14d window, 12h+15m padding start
41-
startDate.setHours(-(14 * 24) - 12, -15, 0, 0);
41+
const chartDurationHours = (14 - 1) * 24; //minus 1 day
42+
startDate.setHours(-chartDurationHours - 12, 0, 0, 0);
4243
endDate.setHours(12, 0, 0, 0);
4344
} else {
4445
// 7d window, 30m+15m padding start
45-
startDate.setHours(startDate.getHours() - 7 * 24, -45, 0, 0);
46-
endDate.setMinutes(30, 0, 0);
46+
const chartDurationHours = (7 * 24) + 1; //plus 1 hour
47+
startDate.setHours(startDate.getHours() - chartDurationHours, 15, 0, 0);
48+
endDate.setMinutes(endDate.getMinutes() + 30, 0, 0);
4749
}
4850
const processed = processDropsSummary(summaryData, displayLod, startDate);
4951
if (!processed) return;

0 commit comments

Comments
 (0)