I have a question related to the sliderInput in R shiny. In the sliderInput, the value is a number. Some examples show that the number is $number. However, if I want to show the value of sliderInput as a time, say 10:00, 15:00, how should I do it? Thanks a lot.
Asked
Active
Viewed 1,422 times
1 Answers
0
This is a partial answer, giving you some pointers that anyone with some JS knowledge can use. To the best of my knowledge, as of Shiny-0.5, you can achieve this only by writing some Javascript/JQuery.
If you are able to incorporate JQuery plug-ins into your UI.R Shiny app, this link has what you want.
Use CSS style to make sure that the
SliderInput
labels get formatted the way you want. (Showing Date/Time as opposed to numbers.) I typically put anytags$head()
styling code insideSideBarPanel()
and it has worked.You will also need a Javascript function that takes in the
input$number
and returns a valid date/time. Link with code: This JQuery post has a javascript function that you should be able use (with DatePicker)
Hope that helps.

Ram Narasimhan
- 22,341
- 5
- 49
- 55
-
Thanks very much. It sounds complex to you. Do you have some sample code to do this? Thanks a lot. – user2564888 Jul 18 '13 at 13:27