I would like to implement a timepicker and dateInput in my Shiny app. However, I did not manage to create a proper timepicker. I tried different options - using the one from http://jdewit.github.io/bootstrap-timepicker/ but if I include the raw html with includeHTML("file.html")
the style is not displayed correctly, I can only see one small box. I downloaded the Bower package, changed the paths in the HTML, still nothing.
Here is my Shiny code:
shinyUI(bootstrapPage(
titlePanel("Dates and date ranges"),
column(4, wellPanel(
dateRangeInput('dates',
label = 'Date range input: yyyy-mm-dd',
start = "2015-03-02", end = "2015-03-15",
weekstart = 1, language = "en"
)
)),
column(6,
verbatimTextOutput("dateRangeText"),
plotOutput("distPlot", width = "100%")
),
includeHTML("static.html")
))
And my HTML:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" href="bower_components/bootstrap-timepicker/css/bootstrap.min.css" />
<link type="text/css" href="bower_components/bootstrap-timepicker/css/bootstrap-timepicker.min.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="bower_components/bootstrap-timepicker/js/bootstrap-2.2.2.min.js"></script>
<script type="text/javascript" src="bower_components/bootstrap-timepicker/js/bootstrap-timepicker.min.js"></script>
</head>
<body>
<div class="input-append bootstrap-timepicker">
<input id="timepicker2" type="text" class="input-small">
<span class="add-on">
<i class="icon-time"></i>
</span>
</div>
<script type="text/javascript">
$('#timepicker2').timepicker({
minuteStep: 1,
template: 'modal',
appendWidgetTo: 'body',
showSeconds: true,
showMeridian: false,
defaultTime: false
});
</script>
</body>
</html>
I'm not really sure what I'm doing wrong as I am new to JS and Web in general, any suggestions? Or perhaps you can advise me to create the timepicker in an easier way. Thanks in advance!
Regards, Boris