#' Version Gadget
#'
#' Popup scherm om handmatig de juiste maand op te geven.
#'
#' @param version A date, ISO format.
#'
#' @return character a date in character format yyyy-mm-dd
#'
#' @export
#' @importFrom magrittr %>%
#'
gadget_version <- function(version = "2021-01-01") {
ui <- miniUI::miniPage(
miniUI::gadgetTitleBar("Provide Version"),
miniUI::miniContentPanel(
shiny::textInput("version",
"Provide Version (yyyy-mm-dd):",
value = version)
)
)
server <- function(input, output){
shiny::observeEvent(input$done, {
shiny::stopApp(input$version)
})
shiny::observeEvent(input$cancel, {
shiny::stopApp(base::stop("Action cancelled", call. = FALSE))
})
}
shiny::runGadget(
shiny::shinyApp(ui, server),
viewer = shiny::dialogViewer(dialogName = "Version"))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.