Browse Source

当前学年计算公式优化

zhuth 6 years ago
parent
commit
20ac7542f0

+ 10 - 2
frontend/pc-web/app/view/Interaction/timetable/Detail.js

@@ -115,10 +115,18 @@ Ext.define('school.view.interaction.timetable.Detail', {
                     let now = new Date();
                     let year = now.getFullYear();
                     let month = now.getMonth() + 1;
-                    let o1, o2;
+                    let o1, o2, termPart;
+                    
                     o1 = [(year - 1) + '-' + year];
                     o2 = [year + '-' + (year + 1)];
-                    return (month < 9) ? o1[0] : o2[0]
+
+                    if((month > 2 && month < 8) || (month == 2 && date > 15) || (month == 8 && date < 15)) {
+                        termPart = o1[0];
+                    }else {
+                        termPart = o2[0];
+                    }
+
+                    return termPart;
                 })()
             }, {
                 xtype: "combobox",

+ 10 - 2
frontend/pc-web/app/view/Interaction/timetable/List.js

@@ -77,10 +77,18 @@ Ext.define('school.view.interaction.timetable.List', {
                     let now = new Date();
                     let year = now.getFullYear();
                     let month = now.getMonth() + 1;
-                    let o1, o2;
+                    let o1, o2, termPart;
+                    
                     o1 = [(year - 1) + '-' + year];
                     o2 = [year + '-' + (year + 1)];
-                    return (month < 9) ? o1[0] : o2[0]
+
+                    if((month > 2 && month < 8) || (month == 2 && date > 15) || (month == 8 && date < 15)) {
+                        termPart = o1[0];
+                    }else {
+                        termPart = o2[0];
+                    }
+
+                    return termPart;
                 })()
             }, {
                 xtype: "combobox",