Skip to content

fix: count days in duration parser#53

Open
KaisAbiyyi wants to merge 2 commits into
tine1117:mainfrom
KaisAbiyyi:codex/fix-day-duration-parser
Open

fix: count days in duration parser#53
KaisAbiyyi wants to merge 2 commits into
tine1117:mainfrom
KaisAbiyyi:codex/fix-day-duration-parser

Conversation

@KaisAbiyyi

@KaisAbiyyi KaisAbiyyi commented Jun 10, 2026

Copy link
Copy Markdown

Closes #1

Summary:

  • Adds the missing d unit to the duration unit table so day values are counted as 86400 seconds.
  • Adds regression coverage for 1d, 2d4h, and an all-unit combined duration string.
  • Updates the README example so the documented d support has a visible working example.

Comparison with existing submissions:

Demo:

PR #53 demo
Verification:

  • python -m unittest discover -s tests
  • manual check: 1d -> 86400, 2d4h -> 187200, 1w2d3h4m5s -> 788645
  • git diff --check

Bounty context: resolves the $50 Algora bounty on #1.

Copilot AI review requested due to automatic review settings June 10, 2026 22:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds support for parsing days (d) in duration strings across implementation, tests, and documentation.

Changes:

  • Add d (days) to supported duration units in duration_utils.py
  • Expand unit parsing tests to cover days and multi-unit combinations
  • Update README usage examples to include day-based durations

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/test_duration_utils.py Adds coverage for parsing d and mixed unit strings including w+d+h+m+s.
duration_utils.py Extends _UNITS with days and documents an additional example.
README.md Documents d usage through an added example call.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread duration_utils.py
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.

parse_duration drops the days (d) unit

2 participants