From f2e9d85500213119afc6b5aa3c87d029b7d19f7d Mon Sep 17 00:00:00 2001 From: psvenk <45520974+psvenk@users.noreply.github.com> Date: Wed, 24 Feb 2021 14:39:42 -0500 Subject: [PATCH] Fix bug with schedule periods Fix an oversight in the code that assigns period names from the schedule. --- public/js/clock.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/public/js/clock.js b/public/js/clock.js index d2751f15..c1646479 100755 --- a/public/js/clock.js +++ b/public/js/clock.js @@ -241,8 +241,11 @@ function get_period_name(default_name, day_of_week) { return name; // For periods 1, 2, 3, 4 stored as strings containing "01", etc. let match; - if ((match = period.match(/0\d/)) && default_name.includes(match[0])) - return name; + if ((match = period.match(/0\d/))) { + if (default_name.includes(match[0].slice(-1))) { + return name; + } + } } return default_name; }