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

Fixes #174, allowing specific days of the week to be disabled. #2147

Merged
merged 4 commits into from Aug 24, 2018

Conversation

nathancday
Copy link
Contributor

Fixes #174, with a new parameter daysofweekdisabled available to dataInput().

An example app:

library(shiny)

shinyApp(
  ui = fluidPage(
    dateInput("date1", "All Days:", daysofweekdisabled = NULL)
    dateInput("date2", "No Weekends:", daysofweekdisabled = c(0,6))
  ), 
  server = function(input, output, session) {}
)

Original code by Niko Eckerskorn (@kadrach). I made this PR because the original fork was 2 years behind master and the issue is still unresolved.

@nathancday
Copy link
Contributor Author

I forced push to my master and I'm not 100% that's what made TravicCI mad, but it was coincidental. Happy to adjust, just let me know the best path to resolution.

R/input-date.R Outdated
#' )
#'
#' shinyApp(ui, server = function(input, output) { })
#' }
#' @export
dateInput <- function(inputId, label, value = NULL, min = NULL, max = NULL,
format = "yyyy-mm-dd", startview = "month", weekstart = 0, language = "en",
format = "yyyy-mm-dd", startview = "month", weekstart = 0,
datesdisabled = NULL, daysofweekdisabled = NULL, language = "en",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move these arguments to the end? Even though this is the right place to put them conceptually, there could be existing code out there that is broken by this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing!

@wch
Copy link
Collaborator

wch commented Aug 6, 2018

Can you send a CLA, as described in https://github.com/rstudio/shiny/blob/master/CONTRIBUTING.md?

@nathancday
Copy link
Contributor Author

CLA sent. Updated argument ordering and added the same conditional formatting for datesdisabled that min and friends have.

@jcheng5 jcheng5 self-requested a review August 8, 2018 21:55
@jcheng5 jcheng5 merged commit 1c70b8b into rstudio:master Aug 24, 2018
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

Successfully merging this pull request may close these issues.

dateInput Request. Restrict to specific dates within min and max
3 participants