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

dateInput Request. Restrict to specific dates within min and max #174

Closed
pssguy opened this issue Jun 12, 2013 · 20 comments · Fixed by #2147
Closed

dateInput Request. Restrict to specific dates within min and max #174

pssguy opened this issue Jun 12, 2013 · 20 comments · Fixed by #2147

Comments

@pssguy
Copy link

pssguy commented Jun 12, 2013

I would like to have, say, only the Fridays clickable. So if one of the parameters could be a vector of allowable dates that would be v useful

@pssguy
Copy link
Author

pssguy commented Jul 19, 2013

I never got any replies to this or #173. Is this the right place to raise enhancement requests?

@trestletech
Copy link
Contributor

Hi. This is a great spot for that. We're pretty swamped with trying to get Shiny Server Pro out the door right now, so we're a bit slow on processing feature requests in Shiny. This is the right spot to put these kinds of requests, though. We'll begin prioritizing and whittling away at some of these new features over the coming months.

@pssguy
Copy link
Author

pssguy commented Jul 19, 2013

Thanks Jeff. It is no big deal but definitely a feature I would be using in apps currently, if available

@pssguy
Copy link
Author

pssguy commented Jan 9, 2014

Just a 6 month repeat request for this and #173
Cheers

@yihui
Copy link
Member

yihui commented Jan 11, 2014

#173 should be easy to solve, but #174 does not seem to be possible, since the datepicker library does not support it (it is only possible to disable certain days of a week): https://github.com/eternicode/bootstrap-datepicker You may file a feature request over there.

@pssguy
Copy link
Author

pssguy commented Jan 11, 2014

Thanks for that. Just took a v brief look at the documentation and it seems like they have a setDates method. http://bootstrap-datepicker.readthedocs.org/en/latest/methods.html
My original request (see above) was for only one day per week so the ability to disable all other days would satisfy that. Obviously if setDates gives additional flexibility that would be even better. An example would be only showing days in a year on which a team played a baseball game

@pssguy
Copy link
Author

pssguy commented Jan 22, 2014

Why is this closed?

The bootstrap-datepicker developer had this to say

"As they said, it's possible to disable certain days of the week (with daysOfWeekDisabled), so they could certainly add a feature that lets you disable every day except Friday.

Enabling specific dates is also possible, though in a roundabout way, using beforeShowDay and checking each date against a list of dates to enable. #515 will make the inverse scenario (disabling specific dates) more straightforward, but it will probably need a counterpart."

@wch
Copy link
Collaborator

wch commented Jan 22, 2014

FYI, this issue hasn't been closed. It's the other one (in which you referenced this issue) that's closed.

@pssguy
Copy link
Author

pssguy commented Jan 22, 2014

OK. Thanks. No wonder I couldn't open it again!

@pssguy
Copy link
Author

pssguy commented Mar 18, 2014

But only slightly ajar? I would find this immensely useful. Kinda surprised if others wouldn't as well

@pssguy
Copy link
Author

pssguy commented Feb 28, 2015

Almost annual update :)

@reidjax
Copy link

reidjax commented Jul 23, 2015

This would be a great feature. Items like quarter/month end options would be very useful as well

@pssguy
Copy link
Author

pssguy commented Jul 31, 2015

Two years on! I have another app where setting allowable dates to a vector of dates would be extremely useful

@trestletech
Copy link
Contributor

Pull requests welcome! :)

@wch wch added the date-time label Aug 11, 2016
@kadrach
Copy link

kadrach commented Sep 8, 2016

I needed this for a project, so added a way to pass this option into the bootstrap datepicker. A more thought-out solution would be to allow passing arbitrary bootstrap datepicker options.

Unfortunately the datepicker version used in Shiny appears to be somewhat outdated, and does not support passing in arbitrary datesDisabled (https://bootstrap-datepicker.readthedocs.io/en/latest/options.html#datesdisabled).

Please let me know if this is an acceptable solution and I'll add a pull request. Caveats so far:

  • Not applied to dateRangeInput (should this affect both datepickers? What if I want to disable different days in start/end picker?)

@daattali
Copy link
Contributor

daattali commented Nov 2, 2016

@kadrach I do believe shiny recently upgraded to datepicker 1.6.4, is that good enough to support this feautre? I'm sure that if you submit a PR, someone on the shiny team will take a look.

@jcheng5 or @wch - should @kadrach submit PR for this? (I'm nudging because I also ran into this issue...)

@raffscallion
Copy link

I am also very interested in this feature. I'd like to prepopulate the datepicker with only the dates that have data to plot.

@detomas83
Copy link

Any update on this issue? I´m interested in using this functionality. Thanks

@jcheng5
Copy link
Member

jcheng5 commented Mar 30, 2017

@daattali @kadrach Either of you feel free to submit a PR. We will need a CLA from @kadrach before we can merge though (once the PR comes in we can send the paperwork). Thanks and sorry for the lack of responsiveness.

@daattali
Copy link
Contributor

Sounds like @kadrach already implemented some extra options. @kadrach could you see if the current shiny datepicker version supports your fix?

In order to add all the arbitrary options that the JS library provides, a design decision needs to be made, ideally from the Shiny team, regarding how the new dateInput() signature should look like:

  1. Have a ... argument, or
  2. Use a options = list() argument (similar to selectizeInput() or DT::datatable()), or
  3. Explicitly list all the supported arguments

@wch wch removed the date-time label Jun 13, 2018
jcheng5 added a commit that referenced this issue Aug 24, 2018
Fixes #174, allowing specific days of the week to be disabled.
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 a pull request may close this issue.

10 participants