Skip to content

fix: add days (d) unit support to parse_duration#69

Open
thanhle74 wants to merge 1 commit into
tine1117:mainfrom
thanhle74:fix/add-days-unit
Open

fix: add days (d) unit support to parse_duration#69
thanhle74 wants to merge 1 commit into
tine1117:mainfrom
thanhle74:fix/add-days-unit

Conversation

@thanhle74

Copy link
Copy Markdown

Summary

The regex pattern r"(\d+)([wdhms])" matches d but the _UNITS dict was missing the days entry, causing parse_duration("1d") to return 0 instead of 86400.

Changes

  • Added "d": 86400 to _UNITS dict
  • Updated comment to list days as supported unit
  • Added comprehensive test cases for days

Test Results

All 12 tests pass (including new day tests).

Fixes #1

The regex pattern matches 'd' but _UNITS dict was missing the days
entry, causing parse_duration('1d') to return 0 instead of 86400.

Fixes tine1117#1
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

1 participant