Skip to content

Commit 9592bb7

Browse files
committed
truncate
1 parent b36e7e0 commit 9592bb7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

timetest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def truncate(cls, dt):
2020
Returns:
2121
date: The first day (January 1) of the decade in which `dt` falls.
2222
"""
23-
return date(10 * (dt.year // 10), 1, 1)
23+
return date(max(10 * (dt.year // 10), 1), 1, 1)
2424

2525
@classmethod
2626
def get_index_for_date(cls, dt):

0 commit comments

Comments
 (0)