Browse Source

Go to next week on weekends

Arnaud Vergnet 4 years ago
parent
commit
28168aacf8
2 changed files with 5 additions and 0 deletions
  1. 4
    0
      src/managers/DateManager.js
  2. 1
    0
      src/screens/Websites/PlanexScreen.js

+ 4
- 0
src/managers/DateManager.js View File

@@ -58,4 +58,8 @@ export default class DateManager {
58 58
         return this.daysOfWeek[date.getDay()] + " " + date.getDate() + " " + this.monthsOfYear[date.getMonth()] + " " + date.getFullYear();
59 59
     }
60 60
 
61
+    static isWeekend(date: Date) {
62
+        return date.getDay() === 6 || date.getDay() === 0;
63
+    }
64
+
61 65
 }

+ 1
- 0
src/screens/Websites/PlanexScreen.js View File

@@ -191,6 +191,7 @@ class PlanexScreen extends React.Component<Props, State> {
191 191
             + OBSERVE_MUTATIONS_INJECTED
192 192
             + FULL_CALENDAR_SETTINGS
193 193
             + "displayAde(" + groupID + ");" // Reset Ade
194
+            + (DateManager.isWeekend(new Date()) ? "calendar.next()" : "")
194 195
             + LISTEN_TO_MESSAGES
195 196
             + INJECT_STYLE;
196 197
 

Loading…
Cancel
Save