Skip to content

Commit

Permalink
Support datetimes on DatetimePicker (#2135)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr authored Mar 31, 2021
1 parent 7a74470 commit 24022e4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions panel/models/datetime_picker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from bokeh.core.properties import (
Bool,
Date,
Datetime,
Either,
Enum,
List,
Expand All @@ -21,23 +22,23 @@ class DatetimePicker(InputWidget):
The initial or picked date.
""")

min_date = Nullable(Date, help="""
min_date = Nullable(Either(Date, Datetime), help="""
Optional earliest allowable date.
""")

max_date = Nullable(Date, help="""
max_date = Nullable(Either(Date, Datetime), help="""
Optional latest allowable date.
""")

disabled_dates = List(Either(Date, Tuple(Date, Date)), default=[], help="""
disabled_dates = List(Either(Date, Datetime, Tuple(Date, Date), Tuple(Datetime, Datetime)), default=[], help="""
A list of dates of ``(start, end)`` date ranges to make unavailable for
selection. All other dates will be avalable.
.. note::
Only one of ``disabled_dates`` and ``enabled_dates`` should be specified.
""")

enabled_dates = List(Either(Date, Tuple(Date, Date)), default=[], help="""
enabled_dates = List(Either(Date, Datetime, Tuple(Date, Date), Tuple(Datetime, Datetime)), default=[], help="""
A list of dates of ``(start, end)`` date ranges to make available for
selection. All other dates will be unavailable.
Expand Down

0 comments on commit 24022e4

Please sign in to comment.