Path: blob/main/examples/reference/widgets/DatetimeRangeInput.ipynb
3199 views
The DatetimeRangeInput widget allows selecting a datetime range using two DatetimeInput widgets, which return a tuple range.
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
format(str): Datetime formatting string that determines how the value is formatted and parsed (default='%Y-%m-%d %H:%M:%S')start(datetime): The range's lower boundend(datetime): The range's upper boundvalue(tuple): Tuple of upper and lower bounds of the selected range expressed as datetime types
Display
disabled(boolean): Whether the widget is editablename(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)":
DatetimeRangeInput.value returns a tuple of datetime values that can be read out and set like other widgets:
Controls
The DatetimeRangeInput widget is a composite widget, which requires Python for communication. Therefore the controls only work when connected in a live Python server/kernel: