@_with_element
def date_input(self, element, label, value=None, min_value=datetime.min, max_value=None, key=None):
    'Display a date input widget.\n\n        Parameters\n        ----------\n        label : str\n            A short label explaining to the user what this date input is for.\n        value : datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None\n            The value of this widget when it first renders. If a list/tuple with\n            0 to 2 date/datetime values is provided, the datepicker will allow\n            users to provide a range. Defaults to today as a single-date picker.\n        min_value : datetime.date or datetime.datetime\n            The minimum selectable date. Defaults to datetime.min.\n        max_value : datetime.date or datetime.datetime\n            The maximum selectable date. Defaults to today+10y.\n        key : str\n            An optional string to use as the unique key for the widget.\n            If this is omitted, a key will be generated for the widget\n            based on its content. Multiple widgets of the same type may\n            not share the same key.\n\n        Returns\n        -------\n        datetime.date\n            The current value of the date input widget.\n\n        Example\n        -------\n        >>> d = st.date_input(\n        ...     "When\'s your birthday",\n        ...     datetime.date(2019, 7, 6))\n        >>> st.write(\'Your birthday is:\', d)\n\n        '
    if (value is None):
        value = datetime.now().date()
    single_value = isinstance(value, (date, datetime))
    range_value = (isinstance(value, (list, tuple)) and (len(value) in (0, 1, 2)))
    if ((not single_value) and (not range_value)):
        raise StreamlitAPIException('DateInput value should either be an date/datetime or a list/tuple of 0 - 2 date/datetime values')
    if single_value:
        value = [value]
    element.date_input.is_range = range_value
    value = [(v.date() if isinstance(v, datetime) else v) for v in value]
    element.date_input.label = label
    element.date_input.default[:] = [date.strftime(v, '%Y/%m/%d') for v in value]
    if isinstance(min_value, datetime):
        min_value = min_value.date()
    element.date_input.min = date.strftime(min_value, '%Y/%m/%d')
    if (max_value is None):
        today = date.today()
        max_value = date((today.year + 10), today.month, today.day)
    if isinstance(max_value, datetime):
        max_value = max_value.date()
    element.date_input.max = date.strftime(max_value, '%Y/%m/%d')
    ui_value = _get_widget_ui_value('date_input', element, user_key=key)
    if (ui_value is not None):
        value = getattr(ui_value, 'data')
        value = [datetime.strptime(v, '%Y/%m/%d').date() for v in value]
    if single_value:
        return value[0]
    else:
        return tuple(value)
Display a date input widget.

Parameters
----------
label : str
    A short label explaining to the user what this date input is for.
value : datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None
    The value of this widget when it first renders. If a list/tuple with
    0 to 2 date/datetime values is provided, the datepicker will allow
    users to provide a range. Defaults to today as a single-date picker.
min_value : datetime.date or datetime.datetime
    The minimum selectable date. Defaults to datetime.min.
max_value : datetime.date or datetime.datetime
    The maximum selectable date. Defaults to today+10y.
key : str
    An optional string to use as the unique key for the widget.
    If this is omitted, a key will be generated for the widget
    based on its content. Multiple widgets of the same type may
    not share the same key.

Returns
-------
datetime.date
    The current value of the date input widget.

Example
-------
>>> d = st.date_input(
...     "When's your birthday",
...     datetime.date(2019, 7, 6))
>>> st.write('Your birthday is:', d)
@_with_element
def date_input(self, element, label, value=None, min_value=datetime.min, max_value=None, key=None):
    'Display a date input widget.\n\n        Parameters\n        ----------\n        label : str\n            A short label explaining to the user what this date input is for.\n        value : datetime.date or datetime.datetime or list/tuple of datetime.date or datetime.datetime or None\n            The value of this widget when it first renders. If a list/tuple with\n            0 to 2 date/datetime values is provided, the datepicker will allow\n            users to provide a range. Defaults to today as a single-date picker.\n        min_value : datetime.date or datetime.datetime\n            The minimum selectable date. Defaults to datetime.min.\n        max_value : datetime.date or datetime.datetime\n            The maximum selectable date. Defaults to today+10y.\n        key : str\n            An optional string to use as the unique key for the widget.\n            If this is omitted, a key will be generated for the widget\n            based on its content. Multiple widgets of the same type may\n            not share the same key.\n\n        Returns\n        -------\n        datetime.date\n            The current value of the date input widget.\n\n        Example\n        -------\n        >>> d = st.date_input(\n        ...     "When\'s your birthday",\n        ...     datetime.date(2019, 7, 6))\n        >>> st.write(\'Your birthday is:\', d)\n\n        '
    if (value is None):
        value = datetime.now().date()
    single_value = isinstance(value, (date, datetime))
    range_value = (isinstance(value, (list, tuple)) and (len(value) in (0, 1, 2)))
    if ((not single_value) and (not range_value)):
        raise StreamlitAPIException('DateInput value should either be an date/datetime or a list/tuple of 0 - 2 date/datetime values')
    if single_value:
        value = [value]
    element.date_input.is_range = range_value
    value = [(v.date() if isinstance(v, datetime) else v) for v in value]
    element.date_input.label = label
    element.date_input.default[:] = [date.strftime(v, '%Y/%m/%d') for v in value]
    if isinstance(min_value, datetime):
        min_value = min_value.date()
    element.date_input.min = date.strftime(min_value, '%Y/%m/%d')
    if (max_value is None):
        today = date.today()
        max_value = date((today.year + 10), today.month, today.day)
    if isinstance(max_value, datetime):
        max_value = max_value.date()
    element.date_input.max = date.strftime(max_value, '%Y/%m/%d')
    ui_value = _get_widget_ui_value('date_input', element, user_key=key)
    if (ui_value is not None):
        value = getattr(ui_value, 'data')
        value = [datetime.strptime(v, '%Y/%m/%d').date() for v in value]
    if single_value:
        return value[0]
    else:
        return tuple(value)