Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d239f13 commit b517175Copy full SHA for b517175
plotly/utils.py
@@ -123,13 +123,16 @@ def datetimeJSONEncoder(self, obj):
123
if _pandas_imported and obj is pandas.NaT:
124
return None
125
126
- if isinstance(obj, (datetime.datetime, datetime.date)):
+
127
+ if isinstance(obj, datetime.datetime):
128
if obj.microsecond:
129
return obj.strftime('%Y-%m-%d %H:%M:%S.%f')
130
elif any((obj.second, obj.minute, obj.hour)):
131
return obj.strftime('%Y-%m-%d %H:%M:%S')
132
else:
133
return obj.strftime('%Y-%m-%d')
134
+ elif isinstance(obj, datetime.date):
135
+ return obj.strftime('%Y-%m-%d')
136
137
raise NotEncodable
138
0 commit comments