Do not convert date if already a date

This commit is contained in:
Lance Edgar 2022-09-06 22:19:01 -05:00
parent f7a019ed83
commit e46f4bf01e

View file

@ -675,6 +675,9 @@ class AlchemyDateFilter(AlchemyGridFilter):
Convert user input to a proper ``datetime.date`` object. Convert user input to a proper ``datetime.date`` object.
""" """
if value: if value:
if isinstance(value, datetime.date):
return value
try: try:
dt = datetime.datetime.strptime(value, '%Y-%m-%d') dt = datetime.datetime.strptime(value, '%Y-%m-%d')
except ValueError: except ValueError: