fix(reading-stats,ui): update heatmap to use local time formatting, fix tooltip css in reading-stats page (#2587)

This commit is contained in:
WorldTeacher
2026-02-06 21:07:42 +01:00
committed by GitHub
parent 37f6417e3d
commit 7124578831
3 changed files with 6 additions and 2 deletions

View File

@@ -178,7 +178,10 @@ export class ReadingSessionHeatmapComponent implements OnInit, OnDestroy {
while (currentDate <= endDate || weekIndex === 0) {
for (let dayOfWeek = 0; dayOfWeek < 7; dayOfWeek++) {
const dateStr = currentDate.toISOString().split('T')[0];
const year = currentDate.getFullYear();
const month = String(currentDate.getMonth() + 1).padStart(2, '0');
const day = String(currentDate.getDate()).padStart(2, '0');
const dateStr = `${year}-${month}-${day}`;
if (currentDate >= startDate && currentDate <= endDate) {
const count = sessionMap.get(dateStr) || 0;

View File

@@ -81,6 +81,7 @@
[pTooltip]="getTooltipContent(session)"
[escape]="false"
tooltipPosition="top"
tooltipStyleClass="session-timeline-tooltip"
[appendTo]="'body'">
@if (isDurationGreaterThanOneHour(session.duration)) {
<div class="session-content">

View File

@@ -367,7 +367,7 @@
}
}
::ng-deep .p-tooltip {
::ng-deep .session-timeline-tooltip.p-tooltip {
--p-tooltip-max-width: 300px;
--p-tooltip-background: rgba(30, 30, 30, 0.98);
--p-tooltip-color: #ffffff;