diff --git a/examples/reference/widgets/DatePicker.ipynb b/examples/reference/widgets/DatePicker.ipynb index 6a4514fbde..2766019c79 100644 --- a/examples/reference/widgets/DatePicker.ipynb +++ b/examples/reference/widgets/DatePicker.ipynb @@ -31,6 +31,8 @@ "\n", "* **``disabled``** (boolean): Whether the widget is editable\n", "* **``name``** (str): The title of the widget\n", + "* **``disabled_dates``** (list): dates to make unavailable for selection; others will be available\n", + "* **``enabled_dates``** (list): dates to make available for selection; others will be unavailable\n", "\n", "___" ] diff --git a/panel/widgets/input.py b/panel/widgets/input.py index 1e4e1aeacf..34cbe7ccf5 100644 --- a/panel/widgets/input.py +++ b/panel/widgets/input.py @@ -8,7 +8,7 @@ import json from base64 import b64decode -from datetime import datetime +from datetime import datetime, date from six import string_types import param @@ -137,6 +137,10 @@ class DatePicker(Widget): end = param.CalendarDate(default=None) + disabled_dates = param.List(default=None, class_=(date, str)) + + enabled_dates = param.List(default=None, class_=(date, str)) + _source_transforms = {'value': None, 'start': None, 'end': None} _rename = {'start': 'min_date', 'end': 'max_date', 'name': 'title'}