streamlit / streamlit

Streamlit — A faster way to build and share data apps.
https://streamlit.io
Apache License 2.0
33.03k stars 2.88k forks source link

Select "Last 7 days" etc on `st.date_input` #8795

Open jrieke opened 4 weeks ago

jrieke commented 4 weeks ago

Checklist

Summary

It would be cool if st.date_input showed some little buttons or a dropdown where you can select "Last 7 days", "Last 30 days", "Last year", etc.

Why?

Makes it a bit more convenient to select common date ranges.

How?

I think we can just add this on the frontend, probably don't need an API to customize it. BaseWeb already supports this but via a dropdown, which has a bit awkward UI. We should probably only allow this if you can actually select a date range, not just a single date.

Additional Context

No response

github-actions[bot] commented 4 weeks ago

To help Streamlit prioritize this feature, react with a 👍 (thumbs up emoji) to the initial post.

Your vote helps us identify which enhancements matter most to our users.

Visits