Browse Source

修复屏蔽时间跨月及跨年bug

ellisran 1 year ago
parent
commit
fb06724f1b
1 changed files with 2 additions and 0 deletions
  1. 2 0
      app/extend/helper.js

+ 2 - 0
app/extend/helper.js

@@ -1692,6 +1692,8 @@ module.exports = {
         function parseTime(stime, timeStr, day = 0) {
             const [hours, minutes] = timeStr.split(':').map(Number);
             const date = new Date();
+            date.setFullYear(stime.getFullYear());
+            date.setMonth(stime.getMonth());
             date.setDate(stime.getDate() + day);
             date.setHours(hours, minutes, 0, 0); // Set hours and minutes, reset seconds and milliseconds
             return date;