Skip to main content

MonthDatePicker / MonthDateRangePicker

selectors.MonthDatePicker
selectors.MonthDateRangePicker

MonthDatePicker and MonthDateRangePicker can be used to allow the user to choose only the month/year part of the date.

ParameterDescriptionDefault
selector_nameThe name of the selector. It must be unique.-
default_valueIf the selected option is invalid, this variable is used. date must match format DD/MM/YYYY
labelThe label for the selector. If not passed, the selector shows its selector_name.-
help_textTooltip help message displayed on hover.-
widthCustom selector width.-
isDisableddisable this selector.False
block_uuidOptional value to specify the block that will be executed when the selector triggers execution.(current block uuid)
min_dateAn optional parameter that specifies the minimum date that can be selected in the selector with format MM/YYYY.. This can be used to restrict the user from selecting dates before a certain date.-
max_dateAn optional parameter that specifies the maximum date that can be selected in the selector with format MM/YYYY. This can be used to restrict the user from selecting dates after a certain date.-

Example:


from IPython.display import display, HTML
elements =[]

picker = selectors.MonthDatePicker(
'mDatePicker-1',
label='A single date for A',
default_value='07/09/2017'
)
elements.append(picker)

picker = selectors.MonthDateRangePicker(
'mdaterangepicker-2',
label='select a range of dates',
help_text='help text',
default_value='05/05/2017-29/06/2017'
)
elements.append(picker)

picker = selectors.MonthDateRangePicker(
'mdaterangepicker-3',
label='select a range of dates and time',
help_text='help text',
default_value='05/05/2017-29/06/2017',
width='190px'
)
elements.append(picker)

elements_html = "".join(
f'<tr><td>{element}</td><td>{element.value}</td></tr>'
for element in elements
)

display(HTML(f"""
<table>
{elements_html}
</table>
"""))
timezones

In these selectors we follow a naive approach to handle dates.

See also​