From 28168aacf8e08304ce8a799a4b2d8f3cf018b535 Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Thu, 16 Apr 2020 10:18:38 +0200 Subject: [PATCH] Go to next week on weekends --- src/managers/DateManager.js | 4 ++++ src/screens/Websites/PlanexScreen.js | 1 + 2 files changed, 5 insertions(+) diff --git a/src/managers/DateManager.js b/src/managers/DateManager.js index 96e4e49..a6cc82b 100644 --- a/src/managers/DateManager.js +++ b/src/managers/DateManager.js @@ -58,4 +58,8 @@ export default class DateManager { return this.daysOfWeek[date.getDay()] + " " + date.getDate() + " " + this.monthsOfYear[date.getMonth()] + " " + date.getFullYear(); } + static isWeekend(date: Date) { + return date.getDay() === 6 || date.getDay() === 0; + } + } diff --git a/src/screens/Websites/PlanexScreen.js b/src/screens/Websites/PlanexScreen.js index 308342d..5bd141e 100644 --- a/src/screens/Websites/PlanexScreen.js +++ b/src/screens/Websites/PlanexScreen.js @@ -191,6 +191,7 @@ class PlanexScreen extends React.Component { + OBSERVE_MUTATIONS_INJECTED + FULL_CALENDAR_SETTINGS + "displayAde(" + groupID + ");" // Reset Ade + + (DateManager.isWeekend(new Date()) ? "calendar.next()" : "") + LISTEN_TO_MESSAGES + INJECT_STYLE;