From daf1ea6d01bf39318429331b86eabf6a4cfcc739 Mon Sep 17 00:00:00 2001 From: fabrixxm Date: Mon, 9 Aug 2021 12:14:51 +0200 Subject: Force LesadaDate.load() return `datetime.date` when parsing --- lesana/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lesana/types.py b/lesana/types.py index 6e5d21d..677fbdf 100644 --- a/lesana/types.py +++ b/lesana/types.py @@ -278,7 +278,7 @@ class LesanaDate(LesanaType): # compatibility with dateutil before 2.8 ParserError = getattr(dateutil.parser, 'ParserError', ValueError) try: - return dateutil.parser.parse(data) + return dateutil.parser.parse(data).date() except ParserError: raise LesanaValueError( "Invalid value for date field: {}".format(data) -- cgit v1.2.3