jQuery UI Datepicker - 只允许某些工作日 [英] jQuery UI Datepicker - allow only certain weekdays
本文介绍了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?
在此先感谢您的帮助,干杯佩德罗
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;
});
这篇关于jQuery UI Datepicker - 只允许某些工作日的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文