Skip to content

Commit

Permalink
Handle noleap calendars
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Jul 28, 2024
1 parent cf1daea commit 63d700d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ def units(draw, *, calendar: str) -> str:
year, month, day = dt.year, dt.month, dt.day
if calendar == "360_day":
day = min(day, 30)
if calendar in ["360_day", "365_day", "noleap"] and month == 2 and day == 29:
day = 28

return f"{time_units} since {year}-{month}-{day}"


Expand Down

0 comments on commit 63d700d

Please sign in to comment.