山东科技大学校历 代码分析 获得以前学期学年的老版校历
创始人
2024-05-25 22:18:29
0

校历-山东科技大学网络安全与信息化办公室http://tech.sdust.edu.cn/wlfw/xl.htm        

JavaScript


var studyStart = new Date(2021, 8-1, 30);//8-1 -1没有意义,30代表30号,2021年8月30号开始这个学期
var commonWeeks = 19;//这个学期有多少周
var smallWeeks = 0;
var vocationWeeks = 6;//寒暑假有多少周

var start = new Date(studyStart.toUTCString());
start.add("d", -28);

var studyWeeks = commonWeeks + smallWeeks;
var totalWeeks = studyWeeks + vocationWeeks;

var div = $("#NavContainer");
var html = '

';
var lastStyle = "m2";
var now = new Date();
now.setHours(0, 0, 0, 0);
var type = start.getMonth() > 5 ? "寒":"暑";
var monthChanged = true;
var i = -1;
while (i
    
    var weekStart = new Date(start.toUTCString());
    weekStart.add("d", 7);
    //alert(weekStart.toString());
    var isCurrentWeek = (now>=start && now     var vocation = studyWeeks < (i+1);
    html += "
        "\">";
    
    for(j=0; j<7; j++) {
        var d = start.getDate();
        var firstStyle = "";
        if (d<2) {
            lastStyle = lastStyle=="m1"?"m2":"m1";
            firstStyle = "firstDay";
            monthChanged = 1; 
            d = "1/" + "" + (start.getMonth() + 1) + "";
        }
        html += "";
        start.add("d", 1);
    }
    html += monthChanged ? "" : "";
    monthChanged = false;
    html += "";
    
    if (start>=studyStart) {
        i++;
    }
}
html += "
周次
        "\">" + (vocation ? type + (i+1-studyWeeks) : (i>-1?i+1:'')) + "             lastStyle + " " + 
            (isCurrentWeek ? "dayCurrentWeek" : "") + " " +
            "\">
            (now > start ? "pastDate" : "") + " " +
            firstStyle + " " + 
            (!(now < start) && !(now > start) ? "today" : "") + " " +
            (j>4 || vocation? "vocation" : "") + " " +
            "\">" + d + "
" + "
" + (start.getMonth()==0?start.getFullYear()+'
':'') + GetMonthName(start.getMonth() + 1) + "月
";
//alert(html);
div.html(html).css("opacity", 1);
// $(".pastDate").css("opacity", 0.3);
 

相关内容

热门资讯

监控摄像头接入GB28181平... 流程简介将监控摄像头的视频在网站和APP中直播,要解决的几个问题是:1&...
Windows10添加群晖磁盘... 在使用群晖NAS时,我们需要通过本地映射的方式把NAS映射成本地的一块磁盘使用。 通过...
protocol buffer... 目录 目录 什么是protocol buffer 1.protobuf 1.1安装  1.2使用...
在Word、WPS中插入AxM... 引言 我最近需要写一些文章,在排版时发现AxMath插入的公式竟然会导致行间距异常&#...
修复 爱普生 EPSON L4... L4151 L4153 L4156 L4158 L4163 L4165 L4166 L4168 L4...
【PdgCntEditor】解... 一、问题背景 大部分的图书对应的PDF,目录中的页码并非PDF中直接索引的页码...
Fluent中创建监测点 1 概述某些仿真问题,需要创建监测点,用于获取空间定点的数据࿰...
educoder数据结构与算法...                                                   ...
MySQL下载和安装(Wind... 前言:刚换了一台电脑,里面所有东西都需要重新配置,习惯了所...
MFC文件操作  MFC提供了一个文件操作的基类CFile,这个类提供了一个没有缓存的二进制格式的磁盘...