mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-10-12 16:11:59 -05:00
Fixes #1280 - Resolved issue in json encoding while dealing with the
date format.
This commit is contained in:
1 parent
fc654a0934
commit
6501f4cf36
1 file changed
+2
-1
@@ -18,7 +18,8 @@ import decimal
|
||||
|
||||
class DataTypeJSONEncoder(json.JSONEncoder):
|
||||
def default(self, obj):
|
||||
if isinstance(obj, datetime.datetime):
|
||||
if isinstance(obj, datetime.datetime) \
|
||||
or hasattr(obj, 'isoformat'):
|
||||
return obj.isoformat()
|
||||
if isinstance(obj, decimal.Decimal):
|
||||
return float(obj)
|
||||
|
||||
Reference in new issue
Block a user