Skip to content

Commit

Permalink
fix:修复日历显示错误
Browse files Browse the repository at this point in the history
  • Loading branch information
CikeyQi committed Nov 5, 2024
1 parent 61d4008 commit dc0e4b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions apps/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ export class Calendar extends plugin {
const startDate = startDateStr || null;
const endDate = endDateStr || null;

const startTime = startDate ? `${startDate.toISOString().slice(5, 10).replace('-', '.')} ${startDate.toTimeString().slice(0, 5)}` : '';
const endTime = endDate ? `${endDate.toISOString().slice(5, 10).replace('-', '.')} ${endDate.toTimeString().slice(0, 5)}` : '';
const startTime = startDate ? `${startDate.toLocaleDateString('zh-CN').slice(5).replace('/', '.')} ${startDate.toTimeString().slice(0, 5)}` : '';
const endTime = endDate ? `${endDate.toLocaleDateString('zh-CN').slice(5).replace('/', '.')} ${endDate.toTimeString().slice(0, 5)}` : '';

const activeStatus = item.countDown
? (startDate && currentDate >= endDate ? '已结束' :
Expand Down Expand Up @@ -83,7 +83,7 @@ export class Calendar extends plugin {
title: '深境再临',
time: (() => {
const cs = s + Math.floor((currentDate - s) / d) * d;
return `${new Date(cs).toLocaleDateString().slice(5).replace('/', '.')} ${new Date(cs).toTimeString().slice(0, 5)} - ${new Date(cs + d).toLocaleDateString().slice(5).replace('/', '.')} ${new Date(cs + d).toTimeString().slice(0, 5)}`;
return `${new Date(cs).toLocaleDateString('zh-CN').slice(5).replace('/', '.')} ${new Date(cs).toTimeString().slice(0, 5)} - ${new Date(cs + d).toLocaleDateString('zh-CN').slice(5).replace('/', '.')} ${new Date(cs + d).toTimeString().slice(0, 5)}`;
})(),
active: '进行中',
remain: this.format(Math.round((s + Math.floor((currentDate - s) / d) * d + d - currentDate) / 1000)),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "waves-plugin",
"version": "1.5.8",
"version": "1.5.9",
"description": "基于 Yunzai 的鸣潮游戏数据查询插件",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit dc0e4b4

Please sign in to comment.