Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a028996

Browse files
committed
💄
1 parent dd4f974 commit a028996

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

plotly/utils.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,14 @@ def numpyJSONEncoder(self, obj):
9292
raise NotEncodable
9393

9494
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
95+
'''
96+
if datetime or iterable of datetimes,
97+
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+
'''
98103
try:
99104
except:
100105
if isinstance(obj, (datetime.datetime, datetime.date)):

0 commit comments

Comments
 (0)