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

Date range input #112

Open
garthtarr opened this issue Mar 7, 2020 · 3 comments
Open

Date range input #112

garthtarr opened this issue Mar 7, 2020 · 3 comments

Comments

@garthtarr
Copy link

Hi, is there a way to have the nice theme but use standard shiny::dateRangeInput()? The theme looks to ruin the original shiny function.

@garthtarr
Copy link
Author

@ericrayanderson Or alternatively, can we add a few more options into shinymaterial::material_date_picker() a really important element is the starting date (called value in the shiny::dateInput() but it would also be nice (though not essential) to have min and max options. Without a default (starting) date functionality I have to go back to the standard shiny date input, which works, but doesn't have the super nice calendar pop up.

Thanks for all your work on this!

shiny::dateInput(
  inputId,
  label,
  value = NULL,
  min = NULL,
  max = NULL,
  format = "yyyy-mm-dd",
  startview = "month",
  weekstart = 0,
  language = "en",
  width = NULL,
  autoclose = TRUE,
  datesdisabled = NULL,
  daysofweekdisabled = NULL
)

@ericrayanderson
Copy link
Owner

@garthtarr

Can you try the most recent dev version remotes::install_github("ericrayanderson/shinymaterial")

New parameter: shinymaterial::material_date_picker(value = "Jul 25, 2020")

@garthtarr
Copy link
Author

Thanks so much for adding this! It works, but there's a slight visual oddity in that when a date is pre-specified using value, the calendar opens up to the correct month, but the date is not initially circled and the "big text" date is still today's date. This behaviour changes once a date is actually clicked in the calendar interface.

library(shiny)
library(shinymaterial)

ui <- material_page(
  title = "Basic Page",
  material_date_picker("test_date", "Pick date", value = "Jan 01, 2020")
)

server <- function(input, output) {  
 
}
shinyApp(ui = ui, server = server)

Before clicking anything in the calendar:

Screen Shot 2020-07-27 at 9 25 14 am

After clicking the same date as that selected using the value argument:

Screen Shot 2020-07-27 at 9 25 17 am

If this is tricky to fix, don't worry about it, the underlying date specification works and it is super useful to be able to specify this. Thanks again!

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