dev: date filtering for issues

This commit is contained in:
pablohashescobar 2024-03-21 13:39:37 +05:30
parent 6ebd215fd6
commit b8aea19715

View File

@ -1,6 +1,7 @@
import re
import uuid
from datetime import timedelta
from django.utils import timezone
# The date from pattern
@ -63,6 +64,7 @@ def date_filter(filter, date_term, queries):
"""
for query in queries:
date_query = query.split(";")
if date_query:
if len(date_query) >= 2:
match = pattern.match(date_query[0])
if match:
@ -81,6 +83,8 @@ def date_filter(filter, date_term, queries):
filter[f"{date_term}__gte"] = date_query[0]
else:
filter[f"{date_term}__lte"] = date_query[0]
else:
filter[f"{date_term}__contains"] = date_query[0]
def filter_state(params, filter, method):