forked from ScoDoc/ScoDoc
JSON: exporte dates au format ISO
This commit is contained in:
parent
caf88c5909
commit
a92d2a6edf
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user