Browse Source

🐞 fix: 修复学期时间输出的问题

Pchen. 4 months ago
parent
commit
d482123090
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/utils/util.js

+ 2 - 2
src/utils/util.js

@@ -8,7 +8,7 @@ export function timeFix() {
 
 
 /**
 /**
  * 学期判断
  * 学期判断
- * 返回 [学期开始时间戳, 当前时间戳]
+ * 返回 [学期开始时间戳, 明日时间戳]
  */
  */
 export function getSemesterTimestamps() {
 export function getSemesterTimestamps() {
   const now = new Date()
   const now = new Date()
@@ -18,7 +18,7 @@ export function getSemesterTimestamps() {
   // 下学期:2 月 1 日 ~ 8 月 31 日
   // 下学期:2 月 1 日 ~ 8 月 31 日
   // 上学期:8 月 31 日 ~ 次年 2 月 1 日
   // 上学期:8 月 31 日 ~ 次年 2 月 1 日
   // 1 月属于上一年的上学期
   // 1 月属于上一年的上学期
-  return [(now >= feb1ThisYear && now < aug31ThisYear) ? feb1ThisYear : new Date(now < feb1ThisYear ? year - 1 : year, 7, 31, 0, 0, 0, 0).getTime(), now.getTime()]
+  return [(now >= feb1ThisYear && now < aug31ThisYear) ? feb1ThisYear.getTime() : new Date(now < feb1ThisYear ? year - 1 : year, 7, 31, 0, 0, 0, 0).getTime(), now.getTime() + 86400000]
 }
 }
 
 
 export async function getNotice(key) {
 export async function getNotice(key) {