var s="2006-10-23";
s=s.replace(/\-/g,"/")
var y="";
if(y.charAt(new Date(s).getDay())=='六')
{}
解决方案 »
- new ActiveXObject("WScript.Shell")调用exe文件时,提示Automation服务器不能创建对象
- log4net引用出错
- 重装后,运行提示用户登陆失败
- asp.net中IIS如何配置(急)
- 【200分】请大家继续帮助讨论ASP.NET用户权限认证授权问题
- 动态生成的Table控件如何取值?
- 怎么在dataset里面写进数据啊?
- 九品厨师大哥请进,关于56KC论谈的问题
- 关于TEXTBOX的AutoPostBack触发条件的问题
- 一个关于无cookie session的简单问题。
- 求一个正则表达式啊 急 !!!!!!
- .NET中,异常详细信息: System.Data.OleDb.OleDbException: 未指定的错误
var base = 1000 * 60 * 60 * 24;
var workingDays = 0;
while (endDate.getTime() - startDate.getTime() > 0){
if(startDate.getDay() != 6 && startDate.getDay() != 0) {
workingDays ++;
}
startDate = new Date(startDate.getTime() + base);
}
return workingDays;
}
自己看看吧~
$('#myCal').click(function() {
startDate = new Date($('#date1').val());
endDate = new Date($('#date2').val());
var base = 1000 * 60 * 60 * 24; //ms getTime() 1000*60*60*24(天)
var workingDays = 0;
while (endDate.getTime() - startDate.getTime() >= 0) {
if (startDate.getDay() == 6 || startDate.getDay() == 0) {//周六或周日
startDate = new Date(startDate.getTime() + base); }
else {
startDate = new Date(startDate.getTime() + base);
workingDays++;
}
}
alert(workingDays);
});
});