Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button Input Option #2

Open
rio-sanjuan opened this issue Oct 26, 2020 · 2 comments
Open

Button Input Option #2

rio-sanjuan opened this issue Oct 26, 2020 · 2 comments

Comments

@rio-sanjuan
Copy link

Is there an easy way to mimic shiny::dateRangeInput's UI? I'd like to make daterangepicker look like this (with the entire container being a single button).

image

It looks like there's a way to make the original daterangepicker appear as a button (here http://www.daterangepicker.com/#ex4), but I'm having trouble getting it to work. Any help or pointers would be greatly appreciated!

@trafficonese
Copy link
Owner

Hey, sry for the late reply.
I am not sure I understand you correctly. You should have full styling capabilities with the style and class arguments. And do you mean example 4 (http://www.daterangepicker.com/#example4)?

This is not what you're asking or?

library(shiny)
library(daterangepicker)

## UI ##########################
ui <- fluidPage(
  br(),
  splitLayout(cellWidths = c("50%", "50%"),
              div(
                div(icon("calendar"), HTML("<b>Date Range</b>")),
                daterangepicker(
                  inputId = "datepicker",
                  style = "width:100%;text-align:center;",
                  class = "form-control",
                  label = NULL,
                  start = as.Date(Sys.time() + (5.5*60*60)) - 1,
                  end = as.Date(Sys.time() + (5.5*60*60)),
                  max = as.Date(Sys.time() + (5.5*60*60))
                ),
              )
  )
  ,dateRangeInput("daterange3", "Date range:",
                 start  = "2001-01-01",
                 end    = "2010-12-31",
                 min    = "2001-01-01",
                 max    = "2012-12-21",
                 separator = " - ")
)

## SERVER ##########################
server <- function(input, output, session) {}

shinyApp(ui, server)

@trafficonese
Copy link
Owner

Can this be closed @rtjohnson12 or are you missing something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants