本文介绍了jQuery工具 - 禁用周末日的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在寻找解决方案,如何在jQuery Tools Datepicker中禁用周末日(sat,sun)。我知道有jQueryUI的解决方案,但是我需要它,因为这个项目几乎完成了99%,所以在这个时候挖掘代码是不好的。
http://flowplayer.org/tools/dateinput/index.html
解决方案
您可以添加如下内容:
$(。date)。dateinput({
change:function(){
var dayOfWeek = this.getValue('ddd');
if dayOfWeek ==='Sat'|| dayOfWeek ==='Sun'){
this.hide();
return false;
}
}
} );
进一步的增强:
- 您可以弹出一个提醒框来警告用户他们不能选择周末
- 你可以设计CSS,使周末看起来不再适用
i'm looking for solution, how to disable weekend days (sat, sun) in jQuery Tools Datepicker. I know there is solution for jQueryUI, but i need it for this, because the project is almost 99% complete, so digging into code for something else isn't good idea at this time.
http://flowplayer.org/tools/dateinput/index.html
解决方案
you could add something like this :
$(".date").dateinput({
change: function() {
var dayOfWeek = this.getValue('ddd');
if( dayOfWeek === 'Sat' || dayOfWeek === 'Sun'){
this.hide();
return false;
}
}
});
Further enhancements:
- you could pop up an alert box to warn the user they cant choose weekends
- you could style the css to make weekends look disabled
这篇关于jQuery工具 - 禁用周末日的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!