It was a long time ago, since this question was asked, but I assume that it remains relevant, since I could not find a satisfactory answer for obtaining temporary inputs.
Below are 3 examples for getting time input.
Firstly, I believe that most people, including me, have been or are looking. Shiny input time object for temporary input. It uses the HTML input time: <input id = 'ui_time' type = 'time'>, followed by a simple javascript function to retrieve the input data before moving on to the Shiny.onInputChange () function for passing as input to the Shiny server.
<input id="ui_time" type="time">
'<script> document.getElementById("ui_time").onchange = function() { var time = document.getElementById("ui_time").value; Shiny.onInputChange("input_html", time); }; </script>'
The second, which is probably not desirable, but adheres to the use of sliders, is a simple but cumbersome hack to create 2 sliders, one to record time, and the other to register minutes before concatenating two results, return the correct time entry.
sliderInput("slider_hours", "Hours:", min=0, max=23, value=0, step = 1), sliderInput("slider_mins", "Mins:",min = 0, max = 59, value = 0, step = 1)
Finally, if date and time formats are required, some may not know how I didn’t, that the slider accepts date time data as POSIXt objects. In this case, the input of the slider can be constructed as follows:
sliderInput("slider_datetime", "Date & Time:", min=as.POSIXlt("2010-01-01 00:00:00", "GMT"), max=as.POSIXlt("2020-01-01 23:59:59", "GMT"), value=as.POSIXlt("2010-01-01 00:00:00", "GMT"), timezone = "GMT")
For those less familiar with brilliant or html, you can view a functional code example in my github: https://github.com/krenova/Shiny_TimeInput/blob/master/app.R
or just run the following line in R:
runGist('https://gist.github.com/krenova/fc184de17892905182a422c96117e989')
I am new to brilliant and html, raised it only last week, so please keep in mind that I may not have done something in the most appropriate way. In any case, I hope this saves someone a few hours!
source share