epicpost/funding/bin/utils.py
2022-08-07 20:15:02 +08:00

8 lines
194 B
Python

from datetime import datetime, date
def json_encoder(obj):
if isinstance(obj, (datetime, date)):
return obj.isoformat()
raise TypeError("Type %s not serializable" % type(obj))