DatePicker#
Download this notebook from GitHub (right-click to download).
import datetime as dt
import panel as pn
import panel_material_ui as pmui
pn.extension()
The DatePicker
widget allows selecting selecting a date value using a text box and the browser’s date-picking utility.
Discover more on using widgets to add interactivity to your applications in the how-to guides on interactivity. Alternatively, learn how to set up callbacks and (JS-)links between parameters or how to use them as part of declarative UIs with Param.
Parameters:#
For details on other options for customizing the component see the customization guides.
Core#
disabled
(boolean): Whether the widget is editabledisabled_dates
(list): dates to make unavailable for selection; others will be availableenabled_dates
(list): dates to make available for selection; others will be unavailableend
(datetime): The latest selectable datestart
(datetime): The earliest selectable datevalue
(datetime): The selected value as a datetime type
Display#
label
(str): The title of the widget
Styling#
sx
(dict): Component level styling API.theme_config
(dict): Theming API.
Aliases#
For compatibility with Panel certain parameters are allowed as aliases:
name
: Alias forlabel
DatePicker
uses a browser-dependent calendar widget to select the date:
date_picker = pmui.DatePicker(label='Date Picker', value=dt.datetime(2024, 4, 1, 11, 37))
pn.Column(date_picker, height=400)
To ensure it is visible in a notebook we have placed it in a Column
with a fixed height.
DatePicker.value
returns a datetime type that can be read out or set like other widgets:
date_picker.value
Controls#
The DatePicker
widget exposes a number of options which can be changed from both Python and Javascript. Try out the effect of these parameters interactively:
pn.Row(date_picker.controls(jslink=False), date_picker)
Download this notebook from GitHub (right-click to download).