Do not correct normalized delta when start date is February 29
Closes #13310 (grafted from 24e4858afe729f717eb6882837808ce479f9dfdc) --HG-- branch : 6.0
This commit is contained in:
@@ -35,7 +35,10 @@ def normalized_delta(start, end):
|
||||
delta = end - start
|
||||
correction = 0
|
||||
if start.year == end.year:
|
||||
if calendar.isleap(start.year) and start.month <= 2 and end.month > 2:
|
||||
if (calendar.isleap(start.year)
|
||||
and (start.month < 2
|
||||
or (start.month == 2 and start.day < 29))
|
||||
and end.month > 2):
|
||||
correction -= 1
|
||||
else:
|
||||
if calendar.isleap(start.year) and start.month <= February:
|
||||
|
||||
Reference in New Issue
Block a user