datetimePickerInput {shinyDatetimePickers}R Documentation

Datetime picker

Description

A datetime picker for a Shiny UI.

Usage

datetimePickerInput(inputId, value = NULL, style = NULL)

Arguments

inputId

the input slot that will be used to access the value

value

initial value, either a POSIXct object, or an object coercible to a POSIXct object; if NULL, it is set to the current time

style

inline CSS for the container

Value

A shiny.tag object that can be included in a Shiny UI.

Examples

if(interactive()){

library(shinyDatetimePickers)
library(shiny)

ui <- fluidPage(
  br(),
  sidebarLayout(
    sidebarPanel(
      tags$fieldset(
        tags$legend("Click to change time"),
        datetimePickerInput(
          "dtpicker",
          style =
            "font-family: Montserrat, 'Segoe UI', Tahoma, sans-serif;"
        )
      )
    ),
    mainPanel(
      verbatimTextOutput("dtpicker")
    )
  )
)

server <- function(input, output){
  output[["dtpicker"]] <- renderPrint({
    input[["dtpicker"]]
  })
}

shinyApp(ui, server)

}

[Package shinyDatetimePickers version 1.2.0 Index]