Skip to content

Latest commit

 

History

History
52 lines (41 loc) · 1.55 KB

README.md

File metadata and controls

52 lines (41 loc) · 1.55 KB

perioddaterangepicker

Lifecycle: maturing R build status Codecov test coverage

Custom Shiny input binding for a Date Range Picker.

Installation

# install.packages("remotes")
remotes::install_github("trafficonese/perioddaterangepicker")

Example

A basic example of a Date Range Picker:

library(shiny)
library(perioddaterangepicker)

## UI ##########################
ui <- fluidPage(
  perioddaterangepicker(
    inputId = "daterange",
    label = "Pick a Date",
    start = Sys.Date() - 30, end = Sys.Date(),
    style = "width:100%; border-radius:4px",
    icon = icon("calendar")
  ),
  verbatimTextOutput("print")
)

## SERVER ##########################
server <- function(input, output, session) {
  output$print <- renderPrint({
    req(input$daterange)
    input$daterange
  })
}

shinyApp(ui, server)

Further examples are in /inst/examples/