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

datesDisable option #515

Merged
merged 2 commits into from Jan 5, 2015
Merged

Conversation

matiasalvarez87
Copy link
Contributor

An array to specify dates to disable. It also adds the .disabled-date class in order to customise the UI.

Usage:

var input = $('<input />').datepicker({
                    format: 'yyyy-mm-dd',
                    datesDisabled: ['2012-10-1', '2012-10-10', '2012-10-20']
                }),

@eternicode
Copy link
Contributor

There's already an option that provides similar functionality, beforeShowDay (you can return false to disable certain dates). Thanks, though!

@eternicode eternicode closed this Jun 18, 2013
@caseyjhol
Copy link

Is there a reason you don't want this built in by default? This is way more convenient than having to create a separate function.

@brockholzer
Copy link

It's definitely odd that you can't simply enter an array of disabled dates as a default option -- pretty basic calendar functionality (holidays/schedules/etc.) I realize there are workarounds in place using beforeShowDay and looping through but it's not the most intuitive solution. This seems like no-brainer functionality to me; appreciate this datesDisabled contribution -- we'll be using it.

@nmackey
Copy link

nmackey commented Oct 31, 2013

This does seem way better and is exactly the functionality I'm looking for. Please reconsider adding this.

+1

@sang4lv
Copy link

sang4lv commented Dec 18, 2013

I definitely need it, beforeShowDay seems like a weird place to hide/disable the date. +1

@acrobat
Copy link
Member

acrobat commented Jan 5, 2015

Thanks @matiasalvarez87!

@acrobat acrobat mentioned this pull request Jan 5, 2015
6 tasks
acrobat added a commit that referenced this pull request Jan 5, 2015
acrobat added a commit to acrobat/bootstrap-datepicker that referenced this pull request Jan 5, 2015
acrobat added a commit to acrobat/bootstrap-datepicker that referenced this pull request Jan 5, 2015
acrobat added a commit that referenced this pull request Jan 7, 2015
acrobat added a commit to acrobat/bootstrap-datepicker that referenced this pull request Mar 9, 2015
acrobat added a commit that referenced this pull request Mar 9, 2015
Added sandbox example for dateDisabled introduced in #515
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants