Skip to content

🐛 Filter out-of-month workdays from monthly work stats#37

Merged
gdarquie merged 3 commits into
mainfrom
fix/work-stats-extra-day
Jul 15, 2026
Merged

🐛 Filter out-of-month workdays from monthly work stats#37
gdarquie merged 3 commits into
mainfrom
fix/work-stats-extra-day

Conversation

@amy-shinsen-openclaw

Copy link
Copy Markdown
Collaborator

Problem

When end_work is called after midnight (crossing from the last day of the previous month into the first day of the current month), phantom StartWork/StopWork annotations are written into the new month first note file but tagged with the previous month workday.

These phantom annotations are found when computing the current month stats (they live in the current month folder) and counted as an extra work day, inflating total_work_days by 1.

Fix

After grouping annotations by workday, discard any entry whose workday does not belong to the requested month.

Test

Added regression test test_work_stats_no_extra_day_when_session_crosses_month_boundary.

@amy-shinsen-openclaw amy-shinsen-openclaw self-assigned this Jul 14, 2026
Comment thread src/plugins/gdarquie_work/work.rs
Comment thread src/plugins/gdarquie_work/work.rs Outdated
@gdarquie
gdarquie merged commit 7615d2b into main Jul 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants