Path: blob/main/examples/reference/widgets/DatetimeInput.ipynb
3220 views
The DatetimeInput widget allows entering a datetime value as text and parsing it using a pre-defined formatter.
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 layout and styling how-to guides.
Core
start(datetime): Lower boundend(datetime): Upper boundvalue(datetime): Parsed datetime value
Display
disabled(boolean): Whether the widget is editableformat(str): Datetime formatting string that determines how the value is formatted and parsed (default='%Y-%m-%d %H:%M:%S')name(str): The title of the widget
The datetime parser uses the defined format to validate the input value, if the entered text is not a valid datetime a warning will be shown in the title as "(invalid)":
DatetimeInput.value returns a datetime object and can be accessed and set like other widgets:
Controls
The DateTimeInput widget exposes a number of options which can be changed from both Python and Javascript. Try out the effect of these parameters interactively: