1、某日是本月第几周:
var mydate=new Date(theyear,themonth-1,theday);
var weekday=mydate.getDay(); //获取该日是星期几,0代表星期日
var weekno=Math.ceil((theday + 6 - weekday) / 7); // 本月第几周
2、本月共有几周:
//先获取本月天数
mydate.setMonth(nmonth); //移到下个月
mydate.setDate(0); //移回到本月最后一天
var totaldays=mydate.getDate();//本月天数
var thelastweekday=mydate.getDay();//最后一天星期几
var weeknum=Math.ceil((totaldays + 6 -thelastweekday) / 7); //本月共有几周