⚠️There's a newer version (0.2.0) of this package. Take me there.

daterangepicker

Custom Shiny input binding for a Date Range Picker.

Installation

# install.packages("remotes")
remotes::install_github("trafficones/daterangepicker")

Example

A basic example of a Date Range Picker:

library(shiny)
library(daterangepicker)

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

## SERVER ##########################
server <- function(input, output, session) {
  output$print <- renderPrint({
    req(input$daterange)
    input$daterange
  })
  observeEvent(input$act, {
    updateDaterangepicker(session, "daterange",
                          start = Sys.Date(), 
                          end = Sys.Date() - 100)
  })
}

shinyApp(ui, server)

Further examples are in /inst/examples/

Further Information

Check out the Configuration Generator for a Live-Demo of the different options.

Copy Link

Version

Down Chevron

Install

install.packages('daterangepicker')

Monthly Downloads

848

Version

0.1.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Last Published

March 20th, 2020

Functions in daterangepicker (0.1.0)