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 63fe909 commit 3a5683bCopy full SHA for 3a5683b
lib/matplotlib/dates.py
@@ -222,6 +222,10 @@ def _to_ordinalf(dt):
222
dt = dt.astimezone(UTC)
223
tzi = UTC
224
225
+ if isinstance(dt, datetime.timedelta):
226
+ base = dt / datetime.timedelta(days=1)
227
+ return base
228
+
229
base = float(dt.toordinal())
230
231
# If it's sufficiently datetime-like, it will have a `date()` method
@@ -405,6 +409,7 @@ def date2num(d):
405
409
Gregorian calendar is assumed; this is not universal practice.
406
410
For details see the module docstring.
407
411
"""
412
408
413
if hasattr(d, "values"):
414
# this unpacks pandas series or dataframes...
415
d = d.values
0 commit comments