How can we use dates with sliderInput
in Shiny?
I know it has been difficult with Bootstrap 2.0, but now that Shiny is using the ion slider, there is hope:
According to the documentation,
Slider supports date and time
For now, something like
sliderInput("date",label="date",
min=as.Date("1934-06-29"), max=as.Date("1940-03-04"))
is still a dream.
I've found some Javascript that seems to be relevant, but I'm not sure hot to implement this in the UI. Has anyone who knows Javascript incorportated this into any Shiny apps yet?
$("#range_39").ionRangeSlider({
min: +moment().subtract(1, "years").format("X"),
max: +moment().format("X"),
from: +moment().subtract(6, "months").format("X"),
prettify: function (num) {
return moment(num, "X").format("LL");
}
});
Thanks for reading this far.