sepal_ui.sepalwidgets.inputs.DatePicker#

class sepal_ui.sepalwidgets.inputs.DatePicker(**kwargs)[source]#

New in version 2.13.0: Empty v_model will be treated as empty string: v_model=''.

Custom input widget to provide a reusable DatePicker.

It allows to choose date as a string in the following format YYYY-MM-DD.

Parameters:
  • label (str) – the label of the datepicker field

  • layout_kwargs (dict | None) – any parameter for the wrapper v.Layout

  • kwargs – any parameter from a v.DatePicker object.

Attributes

check_date

close_menu

date_text

the text field of the datepicker widget

disable

disabled

the disabled status of the Datepicker object

menu

the menu widget to display the datepicker

Methods

__init__

Custom input widget to provide a reusable DatePicker.

is_valid_date

Check if the date is provided using the date format required for the widget.

today

Update the date to the current day.

DatePicker.__init__(label='Date', layout_kwargs=None, **kwargs)[source]#

Custom input widget to provide a reusable DatePicker.

It allows to choose date as a string in the following format YYYY-MM-DD.

Parameters:
  • label (str) – the label of the datepicker field

  • layout_kwargs (dict | None) – any parameter for the wrapper v.Layout

  • kwargs – any parameter from a v.DatePicker object.

Return type:

None

static DatePicker.is_valid_date(date)[source]#

Check if the date is provided using the date format required for the widget.

Parameters:

date (str) – the date to test in YYYY-MM-DD format

Returns:

The validity of the date with respect to the datepicker format

Return type:

bool

DatePicker.today()[source]#

Update the date to the current day.

Return type:

Self