Skip to content

Commit 7b7fab6

Browse files
authored
Update start.mjs
99999
1 parent 173cf1d commit 7b7fab6

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

scripts/start.mjs

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@ const tagPath = path.join('.', 'data', 'tag.json')
5050
const searchPath = path.join('.', 'data', 'search.json')
5151
const componentPath = path.join('.', 'data', 'component.json')
5252

53+
// 获取今天的日期,但将时间和毫秒数重置为零
54+
const today = new Date();
55+
today.setHours(0, 0, 0, 0);
56+
57+
// 计算今天早上8:30的时间戳
58+
const startOfDay = new Date(today);
59+
startOfDay.setHours(8, 30, 0, 0);
60+
61+
// 计算今天下午6:00的时间戳
62+
const endOfDay = new Date(today);
63+
endOfDay.setHours(18, 0, 0, 0);
64+
5365
let internal = {}
5466
let db = []
5567
let settings = {}
@@ -98,17 +110,6 @@ try {
98110
}
99111
//
100112
idx = components.findIndex((item) => item.type === 2)
101-
// 获取今天的日期,但将时间和毫秒数重置为零
102-
const today = new Date();
103-
today.setHours(0, 0, 0, 0);
104-
105-
// 计算今天早上8:30的时间戳
106-
const startOfDay = new Date(today);
107-
startOfDay.setHours(8, 30, 0, 0);
108-
109-
// 计算今天下午6:00的时间戳
110-
const endOfDay = new Date(today);
111-
endOfDay.setHours(18, 0, 0, 0);
112113
const offWork = {
113114
type: 2,
114115
id: -2,
@@ -160,12 +161,12 @@ try {
160161
const countdown2 = {
161162
type: 5,
162163
id: -5,
163-
topColor: 'linear-gradient(90deg, #FAD961 0%, #F76B1C 100%)',
164-
bgColor: 'rgb(235,129,124)',
165-
url: 'https://gcore.jsdelivr.net/gh/xjh22222228/public@gh-pages/nav/component2.jpg',
164+
topColor: 'rgb(79, 131, 198)',
165+
bgColor: 'rgb(255,255,255)',
166+
url: '',
166167
title: '距离休假过年还有',
167-
dateColor: '#fff',
168-
dayColor: '#fff',
168+
dateColor: 'rgb(0,0,0)',
169+
dayColor: 'rgb(0,0,0)',
169170
date: '2025-01-18',
170171
}
171172

0 commit comments

Comments
 (0)