mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-16 04:35:42 +00:00
* 增加#喵喵日历
功能,【!!请注意!!】此功能需要安装 moment,不建议使用#喵喵更新
自动更新,否则可能重启错误
* 请在Yunzai安装目录下运行`npm install moment`后再进行升级! * 功能尚未完全完成,深渊信息及部分样式仍然在调整中 * 调整部分文案与样式
This commit is contained in:
parent
6cadaceea2
commit
1c7795f97b
15
apps/wiki.js
15
apps/wiki.js
@ -155,12 +155,12 @@ export async function calendar(e, { render }) {
|
||||
let totalRange = endTime - startTime;
|
||||
|
||||
let list = [];
|
||||
let getList = (ds, showBanner = false) => {
|
||||
let type = showBanner ? "activity" : "normal",
|
||||
let getList = (ds, isAct = false) => {
|
||||
let type = isAct ? "activity" : "normal",
|
||||
id = ds.ann_id,
|
||||
title = ds.title,
|
||||
banner = showBanner ? ds.banner : '',
|
||||
extra = { sort: showBanner ? 5 : 10 };
|
||||
banner = isAct ? ds.banner : '',
|
||||
extra = { sort: isAct ? 5 : 10 };
|
||||
|
||||
if (ignoreIds.includes(id) || ignoreReg.test(title)) {
|
||||
return;
|
||||
@ -199,9 +199,12 @@ export async function calendar(e, { render }) {
|
||||
|
||||
let label = "";
|
||||
if (now > sDate && eDate > now) {
|
||||
label = eDate.format("MM-DD HH:mm") + " (" + moment.duration(eDate - now).humanize() + ")结束"
|
||||
label = eDate.format("MM-DD HH:mm") + " (" + moment.duration(eDate - now).humanize() + "后结束)"
|
||||
if (width > (isAct ? 38 : 55)) {
|
||||
label = sDate.format("MM-DD HH:mm") + " ~ " + label;
|
||||
}
|
||||
} else if (sDate > now) {
|
||||
label = sDate.format("MM-DD HH:mm") + " (" + moment.duration(sDate - now).humanize() + ")开始"
|
||||
label = sDate.format("MM-DD HH:mm") + " (" + moment.duration(sDate - now).humanize() + "后开始)"
|
||||
}
|
||||
|
||||
list.push({
|
||||
|
@ -206,7 +206,7 @@ body {
|
||||
|
||||
width: 23px;
|
||||
height: 23px;
|
||||
top: 7px;
|
||||
top: 6px;
|
||||
margin-left: -3px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user