Created
June 17, 2011 16:04
-
-
Save treffynnon/1031709 to your computer and use it in GitHub Desktop.
Disable weekends on a jQuery Tools DateInput
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dateinput = $('input[type="date"]').dateinput({ | |
"onShow": function(event) { | |
var calendar = this.getCalendar(); | |
var conf = this.getConf(); | |
var classes = conf.css.off + ' ' + conf.css.disabled; | |
function disableWeekends() { | |
var weeks = calendar.find('.calweek'); | |
weeks.find('a:first, a:last').addClass(classes); | |
} | |
calendar.find('#calprev, #calnext').click(disableWeekends); | |
disableWeekends(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment