-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update FiniteDatetimeRange.days to require passing a TZ
It's possible to create mixed TZ FiniteDatetimeRange's. It probably shouldn't be, but it currently is and this is unlikely to change too soon. See #192 This makes the FiniteDatetimeRange.days poorly defined. For example, should the below range be 31 or 30 days? RANGE = ranges.FiniteDatetimeRange( # This is also 2024-03-01T00:00:00 in TZ_UTC datetime.datetime(2024, 3, 1, tzinfo=TZ_LONDON), # This is 2024-04-01T00:00:00 in TZ_LONDON datetime.datetime(2024, 3, 31, hour=23, tzinfo=TZ_UTC), ) This PR updates FiniteDatetimeRange.days to require passing a TZ, to remove this ambiguity.
- Loading branch information
Showing
2 changed files
with
24 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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