dash_core_components.DatePickerRange
first returns dates with time when selected dates for the first time and only dates from second time onwards.
In below example, I am printing dates as i select dates from picker.
when i select nothing:
when i choose first date:
after i choose second date:
and this is the way it returns after this.
Here’s my code:
from dash import Dash
import dash_core_components as dash_core
import dash_html_components as dash_html
from dash.dependencies import Input, Output
from datetime import datetime
check_app = Dash(__name__)
check_app.layout = dash_html.Div(
children=[
dash_core.DatePickerRange(id='check_date_picker',
start_date=datetime(2014, 1, 1),
end_date=datetime(2015, 1, 31)),
dash_html.Br(),dash_html.Br(),
dash_html.H6(id='printing_dates')
]
)
@check_app.callback(Output(component_id='printing_dates', component_property='children'),
[Input(component_id='check_date_picker', component_property='start_date'),
Input(component_id='check_date_picker', component_property='end_date')])
def print_selected_dates(start_date, end_date):
return str((start_date, end_date))
if __name__ == "__main__":
check_app.run_server()
How do i have dash always return only the dates?
2 posts - 2 participants