Unverified Commit 097daea6 authored by Sparkf's avatar Sparkf 🏙️
Browse files

临时添加判断暑假的逻辑

parent 2c22efcc
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -223,6 +223,14 @@ export default {
        const weekend = now.getDay() === 6 || now.getDay() === 0
        const isHoliday = dayMap[key] == null ? weekend : dayMap[key]
        this.dayType = isHoliday ? 'holiday' : 'workday'
        // parse data from summer_winter_holidays in json
        res.data.summer_winter_holidays.forEach(holiday => {
          const start = new Date(holiday.start)
          const end = new Date(holiday.end)
          if (now >= start && now <= end) {
            this.dayType = 'holiday'
          }
        })
      })
    },

+12 −0
Original line number Diff line number Diff line
@@ -171,5 +171,17 @@
            "date": "2025-10-11",
            "isOffDay": false
        }
    ],
    "summer_winter_holidays": [
        {
            "name": "寒假",
            "start": "2025-01-26",
            "end": "2025-02-23"
        },
        {
            "name": "暑假",
            "start": "2025-07-07",
            "end": "2025-08-23"
        }
    ]
}
 No newline at end of file