forked from ScoDoc/DocScoDoc
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
|
# JSON ENCODING
|
||||||
class ScoDocJSONEncoder(JSONEncoder):
|
class ScoDocJSONEncoder(JSONEncoder):
|
||||||
def default(self, o):
|
def default(self, o):
|
||||||
if isinstance(o, datetime.datetime):
|
if isinstance(o, (datetime.datetime, datetime.date)):
|
||||||
return o.isoformat()
|
return o.isoformat()
|
||||||
|
|
||||||
return super().default(o)
|
return super().default(o)
|
||||||
|
Loading…
Reference in New Issue
Block a user