Update sice.js

This commit is contained in:
Henry Wang
2020-12-28 16:58:30 +00:00
committed by GitHub
parent 24e77b28aa
commit 0575b09923
+2 -2
View File
@@ -7,7 +7,7 @@ module.exports = async (ctx) => {
const $ = cheerio.load(response.data);
const out = $('.notice p').map((index, item) => {
item = $(item);
date = new Date(new Date().getFullYear() + '-' + item.find('a.date').text());
let date = new Date(new Date().getFullYear() + '-' + item.find('a.date').text());
if (new Date() < date) {
date = new Date((new Date().getFullYear() - 1) + '-' + item.find('a.date').text());
}
@@ -26,4 +26,4 @@ module.exports = async (ctx) => {
description: '电子科技大学信息与通信工程学院通知公告',
item: out
};
};
};