获取第几周
getDateParam:function (date) { var nowDate =new Date(date.slice(0,10));//截取日期字符串转换问日期变量 var theWeek = nowDate.getDay(); //当天为周几 var daysOfMonth = nowDate.getDate(); //这个月的第几天 var monthOfYear = nowDate.getMonth()+1; //今年的几月份 var theYear = nowDate.getFullYear(); //年 var weekOfMonth = ""; //这个月的第几周 var arr = ["日","一","二","三","四","五","六"]; if(theWeek == 0){ //这天刚好是周日 weekOfMonth = Math.ceil(daysOfMonth/7); }else { weekOfMonth = Math.ceil((daysOfMonth + 7 - theWeek)/7); } var theWeekStr = theWeek+""; theWeekStr ="周" + theWeekStr.replace(new RegExp(theWeekStr, "g"),arr[theWeek]); var dateParameter = { "theWeekStr":theWeekStr, //周几 "monthOfYear":monthOfYear<10 ? "0"+monthOfYear : monthOfYear, "weekOfMonth":weekOfMonth+"", "theYear":theYear+"", "daysOfMonth":daysOfMonth<10 ? "0"+daysOfMonth : daysOfMonth, "createDate":date.slice(0,10), } return dateParameter; }