telegraphy icon indicating copy to clipboard operation
telegraphy copied to clipboard

JSON Error

Open mightym opened this issue 10 years ago • 1 comments

Telegraphy seems to have problems when serializing datetimeformats. In my case, the field created, a date field:

raise Exception("invalid type for event - serialization failed [%s]" % e) exceptions.Exception: invalid type for event - serialization failed [datetime.datetime(2014, 3, 5, 20, 10, 30) is not JSON serializable]

mightym avatar Mar 05 '14 19:03 mightym

JSON does not support datetime. Django uses an enconder (https://github.com/django/django/blob/master/django/core/serializers/json.py#L84), but we need to unserialize this date in the client (since it'll be just a string). Some plotting libraries prefer epoch-like datetime represetntation, other ISO8601. At first I belive we'll support ISO8601.

D3f0 avatar Mar 10 '14 15:03 D3f0