be a dork about years too

This commit is contained in:
codl 2017-08-09 09:19:18 +02:00
parent 0296f05d8a
commit 7a9106e3bd
No known key found for this signature in database
GPG Key ID: 6CD7C8891ED1233A
1 changed files with 8 additions and 1 deletions

View File

@ -16,7 +16,14 @@ SCALES = [
for year in range(400)))
,31,30,31,30,31,31,30,31,30,31))
)),
('years', timedelta(days=365.25)),
('years', timedelta(days=
# you, a fool: ok. a year is 365.25 days. happy?
# me, wise: absolutely not
mean((366 if year % 400 == 0
or year % 100 != 0 and year % 4 == 0
else 365
for year in range(400)))
)),
]
def decompose_interval(attrname):