jQuery UI Datepicker - 只允许某些工作日
我在一个庞大的项目中使用jquery UI datepicker,现在我意识到在某些方面我只需要允许某些平日。我读了他们的文档,没有找到任何东西..我知道有一些日期提示脚本为jq可以做到这一点,但我不想使用任何额外的脚本,如果可能的话。
任何人都知道任何解决办法吗?也许我误解了他们的文档中的任何内容?
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?
注意:所需行为的示例: http://codeasp.net/blogs/raghav_khunger/microsoft-net/1088/jquery-datepicker-disable-specific-weekdays
NOTE: example of desired behaviour: http://codeasp.net/blogs/raghav_khunger/microsoft-net/1088/jquery-datepicker-disable-specific-weekdays
提前感谢帮助,
Cheers
佩德罗
Thanks in advance for help, Cheers Pedro
$( ".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;
});