From 1c7795f97be819d96285941312e63f2448375fbf Mon Sep 17 00:00:00 2001 From: yoimiya-kokomi <592981798@qq.com> Date: Sat, 7 May 2022 05:47:54 +0800 Subject: [PATCH] =?UTF-8?q?*=20=E5=A2=9E=E5=8A=A0`#=E5=96=B5=E5=96=B5?= =?UTF-8?q?=E6=97=A5=E5=8E=86`=20=E5=8A=9F=E8=83=BD=EF=BC=8C=E3=80=90?= =?UTF-8?q?=EF=BC=81=EF=BC=81=E8=AF=B7=E6=B3=A8=E6=84=8F=EF=BC=81=EF=BC=81?= =?UTF-8?q?=E3=80=91=E6=AD=A4=E5=8A=9F=E8=83=BD=E9=9C=80=E8=A6=81=E5=AE=89?= =?UTF-8?q?=E8=A3=85=20moment=EF=BC=8C=E4=B8=8D=E5=BB=BA=E8=AE=AE=E4=BD=BF?= =?UTF-8?q?=E7=94=A8`#=E5=96=B5=E5=96=B5=E6=9B=B4=E6=96=B0`=20=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=9B=B4=E6=96=B0=EF=BC=8C=E5=90=A6=E5=88=99=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E9=87=8D=E5=90=AF=E9=94=99=E8=AF=AF=20=20=20*=20?= =?UTF-8?q?=E8=AF=B7=E5=9C=A8Yunzai=E5=AE=89=E8=A3=85=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E4=B8=8B=E8=BF=90=E8=A1=8C`npm=20install=20moment`=E5=90=8E?= =?UTF-8?q?=E5=86=8D=E8=BF=9B=E8=A1=8C=E5=8D=87=E7=BA=A7=EF=BC=81=20=20=20?= =?UTF-8?q?*=20=E5=8A=9F=E8=83=BD=E5=B0=9A=E6=9C=AA=E5=AE=8C=E5=85=A8?= =?UTF-8?q?=E5=AE=8C=E6=88=90=EF=BC=8C=E6=B7=B1=E6=B8=8A=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=8F=8A=E9=83=A8=E5=88=86=E6=A0=B7=E5=BC=8F=E4=BB=8D=E7=84=B6?= =?UTF-8?q?=E5=9C=A8=E8=B0=83=E6=95=B4=E4=B8=AD=20=20=20*=20=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E9=83=A8=E5=88=86=E6=96=87=E6=A1=88=E4=B8=8E=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wiki.js | 15 +++++++++------ resources/wiki/calendar.css | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/apps/wiki.js b/apps/wiki.js index 8e939a40..1aa3f8a1 100644 --- a/apps/wiki.js +++ b/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({ diff --git a/resources/wiki/calendar.css b/resources/wiki/calendar.css index 142fd756..cba526fd 100644 --- a/resources/wiki/calendar.css +++ b/resources/wiki/calendar.css @@ -206,7 +206,7 @@ body { width: 23px; height: 23px; - top: 7px; + top: 6px; margin-left: -3px; margin-right: 5px; }