js实现批量排课日期计算效果
代码语言:html
所属分类:其他
代码描述:js实现批量排课日期计算效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>排课</title> </head> <body> <script type="text/javascript"> var sel = 1; //选择星期几 var studyweek = 15; //学习周 /** *获取当前星期几 * */ function getWeekDate() { var now = new Date(); var day = now.getDay(); var weeks = new Array(7, 1, 2, 3, 4, 5, 6); var week = weeks[day]; return week; } function gettoday() { var today = new Date(); today.setTime(today.getTime()); return today.getFullYear()+"-" + (today.getMonth()+1) + "-" + today.getDate(); } var nowweek = getWeekDate(); var nowdate = gettoday(); if (sel >= nowweek) { var startdate = dateAddDays(nowdate, sel-nowweek); document.write(startdate + "<br>"); for (var i = 1; i < studyweek; i++) { startdate = dateAddDays(startdate, 7); document.write(startdate+ "<br>.........完整代码请登录后点击上方下载按钮下载查看
网友评论0