Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/trafficonese/daterangepicker
Shiny Input for Date Ranges
https://github.com/trafficonese/daterangepicker
daterangepicker r shiny
Last synced: 3 months ago
JSON representation
Shiny Input for Date Ranges
- Host: GitHub
- URL: https://github.com/trafficonese/daterangepicker
- Owner: trafficonese
- License: other
- Created: 2020-03-13T15:13:54.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-07-14T20:59:41.000Z (over 1 year ago)
- Last Synced: 2024-07-29T19:24:58.725Z (3 months ago)
- Topics: daterangepicker, r, shiny
- Language: JavaScript
- Homepage: https://trafficonese.github.io/daterangepicker/
- Size: 683 KB
- Stars: 15
- Watchers: 3
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - trafficonese/daterangepicker - Shiny Input for Date Ranges (JavaScript)
README
# daterangepicker
[![](https://www.r-pkg.org/badges/version/daterangepicker)](https://www.r-pkg.org/pkg/daterangepicker)
[![cran checks](https://badges.cranchecks.info/worst/daterangepicker.svg)](https://cran.r-project.org/web/checks/check_results_daterangepicker.html)
[![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/daterangepicker?color=brightgreen)](https://www.r-pkg.org/pkg/daterangepicker)
[![CRAN Downloads](http://cranlogs.r-pkg.org/badges/grand-total/daterangepicker)](https://cranlogs.r-pkg.org/badges/grand-total/daterangepicker)
[![R build status](https://github.com/trafficonese/daterangepicker/workflows/R-CMD-check/badge.svg)](https://github.com/trafficonese/daterangepicker/actions)
[![Lifecycle: maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html)
[![Codecov test coverage](https://codecov.io/gh/trafficonese/daterangepicker/branch/master/graph/badge.svg)](https://app.codecov.io/gh/trafficonese/daterangepicker?branch=master)Custom Shiny input binding for a [Date Range Picker](https://www.daterangepicker.com/).
## Installation from CRAN
``` r
install.packages("daterangepicker")
```or the dev version:
``` r
# install.packages("remotes")
remotes::install_github("trafficonese/daterangepicker")
```## Example
A basic example of a Date Range Picker:
``` r
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/](https://github.com/trafficonese/daterangepicker/tree/master/inst/examples)
## Further Information
Check out the [Configuration Generator](https://www.daterangepicker.com/#config) for a Live-Demo of the different options.