diff --git a/accounting/views.py b/accounting/views.py index 64b3f9d..ee077c0 100644 --- a/accounting/views.py +++ b/accounting/views.py @@ -795,6 +795,13 @@ def search(request: HttpRequest) -> HttpResponse: | Q(transaction__date__year=date.year) except ValueError: pass + try: + date = datetime.datetime.strptime(query, "%Y/%m") + conditions = conditions\ + | (Q(transaction__date__year=date.year) + & Q(transaction__date__month=date.month)) + except ValueError: + pass try: date = datetime.datetime.strptime(query, "%m/%d") conditions = conditions\