Repository navigation
Conversation
The daily report took logs whose clock-in or clock-out fell on the day. A session covering the whole day, or still open since an earlier day, was left out (11/16 showed 2 active users while a member had been in since 11/13), and a counted session's full length went to that day ("Longest duration 65 hr"). It now takes every session that overlaps the day and counts only the part within it.
The user report put each session's full length on the UTC date it started, so a day could show "65h" and "Avg / Day" could pass 24 hours, and early-morning sessions in Taipei landed on the day before. Sessions are now split at midnight in TZ, and with a period selected only the part inside it counts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The daily and user reports put whole sessions on one day, so their numbers could be impossible:
This PR changes:
TZ(splitByDayinzoned-time.ts) for the daily breakdown, calendar and "Days attended". With a period selected, only the part inside it counts toward the totals.Evidence
Same preview data, before and after:
New tests for
splitByDay: splitting at Taipei midnight, not UTC, and a same-day or empty session.tsc --noEmit, ESLint on the changed files andnpm run buildpass.Merge danger
Door: two-way. Report reads only.
Blast radius:
/report/dailyand/report/user. Past days will show different numbers than before, and the new ones are the right ones; worth saying if anyone compares with old screenshots.🤖 Generated with Claude Code