🐛 Use today as workday when end_work crosses midnight into a new day - #38
Closed
amy-shinsen-openclaw wants to merge 1 commit into
Closed
🐛 Use today as workday when end_work crosses midnight into a new day#38amy-shinsen-openclaw wants to merge 1 commit into
amy-shinsen-openclaw wants to merge 1 commit into
Conversation
Contributor
|
No, this is not a bug but a feature 😁 When you work late because of different time period, what you do after midnight should be considered as the work day of "yesterday". |
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.
Root cause
When
end_workis called after midnight (work started yesterday), the "yesterday" branch creates bridge annotations in today's file:StartWorkat00:00:00withworkday = yesterday← wrongStopWorkat the current time withworkday = yesterday← wrongBecause both carry yesterday's workday, they appear in the current month's stats as an extra worked day for yesterday — even though yesterday may belong to the previous month.
Fix
StartWorkbridge at00:00now uses today as workday.StopWorknow uses today as workday when crossing midnight.This ensures that annotations written into today's note file are correctly attributed to today in the stats.
Relationship to PR #37
PR #37 (
fix/work-stats-extra-day) fixes the symptom by filtering out-of-month workdays from stats. This PR fixes the root cause by preventing the wrong workday from being written in the first place. Both are complementary.