Skip to content

Instantly share code, notes, and snippets.

@treffynnon
Created June 17, 2011 16:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save treffynnon/1031709 to your computer and use it in GitHub Desktop.
Save treffynnon/1031709 to your computer and use it in GitHub Desktop.
Disable weekends on a jQuery Tools DateInput
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