fix(reading sessions): Split sessions, re-calculate times in book overview (#2393)

* do not group reading sessions on a per-day basis

* calculate actual duration for reading sessions

---------

Co-authored-by: WorldTeacher <coding_contact@pm.me>
This commit is contained in:
WorldTeacher
2026-01-22 13:04:17 -07:00
committed by GitHub
co-authored by WorldTeacher
parent 97343ee067
commit d137055b83
6 changed files with 74 additions and 31 deletions
@@ -145,8 +145,8 @@ export class ReadingSessionTimelineComponent implements OnInit {
response.forEach((item) => {
const startTime = new Date(item.startDate);
const duration = item.totalDurationSeconds / 60;
const endTime = new Date(startTime.getTime() + item.totalDurationSeconds * 1000);
const endTime = item.endDate ? new Date(item.endDate) : new Date(startTime.getTime() + item.totalDurationSeconds * 1000);
const duration = (endTime.getTime() - startTime.getTime()) / (1000 * 60);
sessions.push({
startTime,