Fix last month date range (#187)

This commit is contained in:
havk 2022-01-02 15:37:19 +01:00 committed by GitHub
parent 71ec196ec4
commit 8b0205a2f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,6 +45,13 @@ class DateRangeMixin:
"start": now.replace(day=1),
"end": now,
},
{
"name": "Last month",
"start": (now.replace(day=1) - timezone.timedelta(days=1)).replace(
day=1
),
"end": now.replace(day=1) - timezone.timedelta(days=1),
},
{
"name": "This year",
"start": now.replace(day=1, month=1),