I'm using jquery UI datepicker on a huge project and I realize now that I'll need to allow only certain weekdays on some areas. I read their documentation and didn't find anything about it.. I know that there are some datepickers scripts for jq which can do this but I don't want to use any additional script for this if it's possible. Anyone know any workaround for this? Maybe I'm misunderstood anything in their documentation?
NOTE: example of desired behaviour: http://codeasp.net/blogs/raghav_khunger/microsoft-net/1088/jquery-datepicker-disable-specific-weekdays
Thanks in advance for help, Cheers Pedro
@Jan Thomas forgot to add the variable td. The correct code is:
$( ".datepicker.future" ).datepicker('option','beforeShowDay',function(date){
var td = date.getDay();
var ret = [(date.getDay() != 0 && date.getDay() != 6),'',(td != 'Sat' && td != 'Sun')?'':'only on workday'];
return ret;
});
$( ".datepicker.future" ).datepicker('option','beforeShowDay',function(date){
var td = date.getDay();
var ret = [(date.getDay() != 0 && date.getDay() != 6),'',(td != 'Sat' && td != 'Sun')?'':'only on workday'];
return ret;
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With