MCPcopy Index your code
hub / github.com/plotly/plotly.py / _is_date_string

Function _is_date_string

plotly/shapeannotation.py:6–14  ·  view source on GitHub ↗

Check if a value is a date/datetime string.

(val)

Source from the content-addressed store, hash-verified

4
5
6def _is_date_string(val):
7 """Check if a value is a date/datetime string."""
8 if not isinstance(val, str):
9 return False
10 try:
11 datetime.datetime.fromisoformat(val.replace("Z", "+00:00"))
12 return True
13 except (ValueError, AttributeError):
14 return False
15
16
17def _datetime_str_to_ms(val):

Callers 1

_meanFunction · 0.85

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected