I am looking to use a slider for an app to provide lower and upper dates on a parameter. Since
st.slider only supports floats, I first convert my dates to
timestamp, with the idea of using the
format parameter in the
st.slider to show something understandable to the user.
However, I cannot seem to find an example of how this is done. For now, I have the following code:
st.slider("Plotting window", value=(min(list_of_days).timestamp(), max(list_of_days).timestamp()), format='%s'.format(datetime.utcfromtimestamp().strftime('%d/%m/%y')))
list_of_days is, well, a list of days. This does not run since the
utcfromtimestamp() needs an input parameter, i.e. the value that is to be converted. How can I get that?
I think it might be good to include an example in the API reference guide (or even better, enable support for datetime? ).