From a92d2a6edf81391648b3c44f6fdefd784026a465 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sun, 23 Oct 2022 14:51:57 +0200 Subject: [PATCH] JSON: exporte dates au format ISO --- app/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/__init__.py b/app/__init__.py index e9953eec8..428ba1641 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -119,7 +119,7 @@ def handle_invalid_usage(error): # JSON ENCODING class ScoDocJSONEncoder(JSONEncoder): def default(self, o): - if isinstance(o, datetime.datetime): + if isinstance(o, (datetime.datetime, datetime.date)): return o.isoformat() return super().default(o)