mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-23 01:06:31 -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):
|
class DataTypeJSONEncoder(json.JSONEncoder):
|
||||||
def default(self, obj):
|
def default(self, obj):
|
||||||
if isinstance(obj, datetime.datetime):
|
if isinstance(obj, datetime.datetime) \
|
||||||
|
or hasattr(obj, 'isoformat'):
|
||||||
return obj.isoformat()
|
return obj.isoformat()
|
||||||
if isinstance(obj, decimal.Decimal):
|
if isinstance(obj, decimal.Decimal):
|
||||||
return float(obj)
|
return float(obj)
|
||||||
|
Loading…
Reference in New Issue
Block a user