fix(reading-stats,ui): update heatmap to use local time formatting, fix tooltip css in reading-stats page (#2587)
This commit is contained in:
+4
-1
@@ -178,7 +178,10 @@ export class ReadingSessionHeatmapComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
while (currentDate <= endDate || weekIndex === 0) {
|
while (currentDate <= endDate || weekIndex === 0) {
|
||||||
for (let dayOfWeek = 0; dayOfWeek < 7; dayOfWeek++) {
|
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) {
|
if (currentDate >= startDate && currentDate <= endDate) {
|
||||||
const count = sessionMap.get(dateStr) || 0;
|
const count = sessionMap.get(dateStr) || 0;
|
||||||
|
|||||||
+1
@@ -81,6 +81,7 @@
|
|||||||
[pTooltip]="getTooltipContent(session)"
|
[pTooltip]="getTooltipContent(session)"
|
||||||
[escape]="false"
|
[escape]="false"
|
||||||
tooltipPosition="top"
|
tooltipPosition="top"
|
||||||
|
tooltipStyleClass="session-timeline-tooltip"
|
||||||
[appendTo]="'body'">
|
[appendTo]="'body'">
|
||||||
@if (isDurationGreaterThanOneHour(session.duration)) {
|
@if (isDurationGreaterThanOneHour(session.duration)) {
|
||||||
<div class="session-content">
|
<div class="session-content">
|
||||||
|
|||||||
+1
-1
@@ -367,7 +367,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
::ng-deep .p-tooltip {
|
::ng-deep .session-timeline-tooltip.p-tooltip {
|
||||||
--p-tooltip-max-width: 300px;
|
--p-tooltip-max-width: 300px;
|
||||||
--p-tooltip-background: rgba(30, 30, 30, 0.98);
|
--p-tooltip-background: rgba(30, 30, 30, 0.98);
|
||||||
--p-tooltip-color: #ffffff;
|
--p-tooltip-color: #ffffff;
|
||||||
|
|||||||
Reference in New Issue
Block a user