PageSourceSearch

http://www.81.cn/material/js/addbg.js?v=1.0.2

js 81.cn collected 2026-10-02 02:56:42 UTC 1,733 bytes, 62 lines download raw bytes

1// 判断时间区间显示背景图
2; (function () {
3  var body = $('body')
4  var startTimer = body.attr('data-start-timer')
5  var endTimer = body.attr('data-end-timer')
6
7  if (!startTimer) {
8    return
9  }
10  // 获取当前日期
11  var getDateTime = function () {
12    // 格式化日对象
13    var date = new Date();
14    var sign2 = ":";
15    var year = date.getFullYear() // å¹´
16    var month = date.getMonth() + 1; // 月
17    var day = date.getDate(); // 日
18    var hour = date.getHours(); // 时
19    var minutes = date.getMinutes(); // 分
20    var seconds = date.getSeconds() //秒
21    var weekArr = ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期天'];
22    var week = weekArr[date.getDay()];
23    // 给一位数的数据前面加 “0”
24    if (month >= 1 && month <= 9) {
25      month = "0" + month;
26    }
27    if (day >= 0 && day <= 9) {
28      day = "0" + day;
29    }
30    if (hour >= 0 && hour <= 9) {
31      hour = "0" + hour;
32    }
33    if (minutes >= 0 && minutes <= 9) {
34      minutes = "0" + minutes;
35    }
36    if (seconds >= 0 && seconds <= 9) {
37      seconds = "0" + seconds;
38    }
39    return year + "-" + month + "-" + day + " " + hour + sign2 + minutes + sign2 + seconds;
40  };
41  // 判断现在时间班次
42  var date = {
43    isDuringDate: function (beginDate, endDate) {
44      var curDate = getDateTime();
45      if (endDate) {
46        // 有结束时间
47        if (curDate >= beginDate && curDate <= endDate) {
48          return true;
49        }
50      } else {
51        // 无结束时间
52        if (curDate >= beginDate) {
53          return true;
54        }
55      }
56      return false;
57    }
58  }
59  if (date.isDuringDate(startTimer, endTimer)) {
60    body.addClass('env-lh')
61  }
62})()

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.