mirror of
https://github.com/home-assistant/core.git
synced 2025-07-31 19:25:12 +02:00
Fix recorder "year" period in leap year (#132167)
* FIX: make "year" period work in leap year
* Add test
* Set second and microsecond to non-zero in test start times
* FIX: better fix for leap year problem
* Revert "FIX: better fix for leap year problem"
This reverts commit 06aba46ec6
.
---------
Co-authored-by: Erik <erik@montnemery.com>
This commit is contained in:
@@ -902,7 +902,7 @@ def resolve_period(
|
||||
start_time = (start_time + timedelta(days=cal_offset * 366)).replace(
|
||||
month=1, day=1
|
||||
)
|
||||
end_time = (start_time + timedelta(days=365)).replace(day=1)
|
||||
end_time = (start_time + timedelta(days=366)).replace(day=1)
|
||||
|
||||
start_time = dt_util.as_utc(start_time)
|
||||
end_time = dt_util.as_utc(end_time)
|
||||
|
Reference in New Issue
Block a user