Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabled disabled dates #1524

Merged
merged 9 commits into from
Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/reference/widgets/DatePicker.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
"___"
]
Expand Down
6 changes: 5 additions & 1 deletion panel/widgets/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'}
Expand Down