Skip to content

Commit

Permalink
Enabled disabled dates (#1524)
Browse files Browse the repository at this point in the history
* Allow embedding local file

* Remove is_url check

* Reverse logic

* Add disabled_dates and enabled_dates to DatePicker

* Add docs

Co-authored-by: ahuang11 <ahuang11@illinois.edu>
  • Loading branch information
ahuang11 and ahuang11 authored Aug 11, 2020
1 parent f860842 commit f2e1bf8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
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

0 comments on commit f2e1bf8

Please sign in to comment.