diff --git a/doc/changelog.rst b/doc/changelog.rst index ffbe96c..9cf2870 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -5,9 +5,16 @@ v0.12.0 ------- API Changes ------------ +*********** + - mizani now requires python 3.9 and above. +Bug Fixes +********* + +- Fixed bug where a date with a timezone could lose the timezone. :issue:`45`. + + v0.11.4 ------- *2024-05-24* diff --git a/mizani/_core/date_utils.py b/mizani/_core/date_utils.py index 6fe0ec3..b64f1e0 100644 --- a/mizani/_core/date_utils.py +++ b/mizani/_core/date_utils.py @@ -291,7 +291,11 @@ def floor_day(d: datetime) -> datetime: """ Round down to the start of the day """ - return d.min.replace(d.year, d.month, d.day) if has_time(d) else d + return ( + d.min.replace(d.year, d.month, d.day, tzinfo=d.tzinfo) + if has_time(d) + else d + ) def ceil_day(d: datetime) -> datetime: