Use ISO 8601 as the default datetime format

This commit is contained in:
Patrick Jentsch
2021-09-08 12:56:51 +02:00
parent 8c871d83d0
commit 281e568edf
4 changed files with 16 additions and 16 deletions

View File

@ -96,9 +96,9 @@ def ressource_after_update_handler(mapper, connection, ressource):
if not history.has_changes():
continue
new_value = history.added[0]
# DateTime attributes must be converted to a timestamp
# DateTime attributes must be converted to a string
if isinstance(new_value, datetime):
new_value = new_value.timestamp()
new_value = new_value.isoformat()
jsonpatch.append(
{
'op': 'replace',