Selaa lähdekoodia

fix:GUIT适配自定义时间判断问题

Mercury 1 kuukausi sitten
vanhempi
sitoutus
3108a42414
1 muutettua tiedostoa jossa 16 lisäystä ja 0 poistoa
  1. 16 0
      resources/GUIT/guit_01.js

+ 16 - 0
resources/GUIT/guit_01.js

@@ -164,6 +164,10 @@ function fillCustomTime(course) {
         return course;
     }
 
+    if (course.startSection >= 5 && course.endSection <= 11) {
+        return course;
+    }
+
     const timeSlotMap = getTimeSlotMap(scheduleType);
     const startSlot = timeSlotMap.get(course.startSection);
     const endSlot = timeSlotMap.get(course.endSection);
@@ -171,6 +175,18 @@ function fillCustomTime(course) {
         return course;
     }
 
+    const primaryTimeSlotMap = new Map(PRIMARY_TIME_SLOTS.map((slot) => [slot.number, slot]));
+    const primaryStartSlot = primaryTimeSlotMap.get(course.startSection);
+    const primaryEndSlot = primaryTimeSlotMap.get(course.endSection);
+    if (
+        primaryStartSlot &&
+        primaryEndSlot &&
+        primaryStartSlot.startTime === startSlot.startTime &&
+        primaryEndSlot.endTime === endSlot.endTime
+    ) {
+        return course;
+    }
+
     return {
         ...course,
         isCustomTime: true,