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 dd4f974 commit a028996Copy full SHA for a028996
plotly/utils.py
@@ -92,9 +92,14 @@ def numpyJSONEncoder(self, obj):
92
raise NotEncodable
93
94
def datetimeJSONEncoder(self, obj):
95
- # if datetime or iterable of datetimes, convert to a string that plotly understands
96
- # format as %Y-%m-%d %H:%M:%S.%f, %Y-%m-%d %H:%M:%S, or %Y-%m-%d depending on what non-zero resolution was provided
97
- import datetime
+ '''
+ if datetime or iterable of datetimes,
+ convert to a string that plotly understands
98
+ format as %Y-%m-%d %H:%M:%S.%f,
99
+ %Y-%m-%d %H:%M:%S, or
100
+ %Y-%m-%d
101
+ depending on what non-zero resolution was provided
102
103
try:
104
except:
105
if isinstance(obj, (datetime.datetime, datetime.date)):
0 commit comments