Skip to content

Commit f18e8b3

Browse files
committed
style: added some comments
1 parent e77c4a8 commit f18e8b3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

idf_analysis/little_helpers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,11 @@ def timedelta_readable2(d1, d2, min_freq='min', short=False, sep=', ', lang='en'
415415

416416
years = None
417417
if td > pd.Timedelta(days=365):
418+
# date of d2 but year of d1
418419
d2_new = d2.replace(year=d1.year)
419420

420421
if d2_new < d1:
422+
# if day of d2 is earlier in the year ad day of d1
421423
d2_new = d2_new.replace(year=d1.year + 1)
422424

423425
years = d2.year - d2_new.year

0 commit comments

Comments
 (0)