mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-22 16:56:30 -06:00
Fixes #1280 - Resolved issue in json encoding while dealing with the
date format.
This commit is contained in:
parent
fc654a0934
commit
6501f4cf36
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user