Actually, we can use DATE_PARSER_LANGUAGES

This commit is contained in:
shamoon committed 2026-10-22 00:07:30 -07:00
1 parent 23d00112d3
commit 49ce97fc5f
1 file changed
+2 -1
+2 -1
View File
@@ -12,6 +12,7 @@ from typing import TYPE_CHECKING
from typing import Any
import dateparser
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.db.models import Case
from django.db.models import CharField
@@ -352,7 +353,7 @@ class DateQueryField(serializers.DateField):
try:
parsed = dateparser.parse(
value,
languages=["en"],
locales=settings.DATE_PARSER_LANGUAGES,
settings={
"PARSERS": ["relative-time"],
"RELATIVE_BASE": self.reference_datetime,