Skip to content

Commit

Permalink
Fix bug where default configuration would cause tomorrow's schedule t…
Browse files Browse the repository at this point in the history
…o be shown rather than today's
  • Loading branch information
Newbytee committed Sep 1, 2020
1 parent e0a4734 commit 0da36b3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -488,18 +488,21 @@ function setupNeoschedule() {
DAY_DROPDOWN.selectedIndex = 1;
}

const switchoverTime = CONFIG.getVar("switchoverTime");

const [
switchoverHourString,
switchoverMinuteString
] = CONFIG.getVar("switchoverTime").split(":");
] = switchoverTime.split(":");

const switchoverHour = parseInt(switchoverHourString);
const switchoverMinute = parseInt(switchoverMinuteString);

const currentHour = DATE.getHours();

if (
!((switchoverHour === currentHour &&
!(switchoverTime === "00:00" ||
(switchoverHour === currentHour &&
switchoverMinute >= DATE.getMinutes()) ||
switchoverHour > currentHour) &&
currentDay !== 0 &&
Expand Down

0 comments on commit 0da36b3

Please sign in to comment.