Streamlit.date_input to indicate the start and end date

Hi everyone, I like to have an interactive widget to indicate the date ranges using st.date_input, how can I do that.

I’ve tried st.slider, but I like to know if I can apply the same on st.date_input.

Thank you!

Hi @C45513,

First, Welcome to our Streamlit Community!!! :tada: :tada: :tada: :partying_face: :tada: :tada: :tada:

I think you can do what you want here with the st.date_input since you can pass min_value and max_value as parameters so the user cannot select a date outside these values.

Check out the docs on how to implement this!

Happy Streamlit-ing!
Marisa

1 Like

Thank Marisa,

I’m able to create the range as input with incorporating the vaue as follow:
value=(datetime(2020, 1, 1), datetime(2030, 1, 1))

Thanks,
Cassie

1 Like