Skip to content

Commit

Permalink
Update db.py
Browse files Browse the repository at this point in the history
  • Loading branch information
michplunkett committed Dec 20, 2024
1 parent fd5f406 commit e74eff2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion OpenOversight/app/utils/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ class CustomJSONEncoder(JSONEncoder):
"""

def default(self, obj):
if isinstance(obj, (date, time, datetime)):
if isinstance(obj, (date, datetime)):
return obj.isoformat()

if isinstance(obj, time):
return obj.strftime("%T")

return super().default(obj)

0 comments on commit e74eff2

Please sign in to comment.