Skip to content

Commit

Permalink
Lunch detection hotfix following Aspen changes
Browse files Browse the repository at this point in the history
Aspen changed the format for displaying periods from "0n" to "BLOCK n",
necessitating a change in the lunch detection code (which I should not
have written so rigidly in the first place).
  • Loading branch information
psvenk committed May 9, 2021
1 parent 527e097 commit d1476f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion public/js/clock.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ function get_period_name(default_name, day_of_week) {
// Guess lunch if there is a period 3 and we are not following the
// covid schedule
for (const { period, room, id } of period_names.black) {
if (/03/.test(period)) {
if (period.includes("03") || period.includes("BLOCK 3")) {
// Get base of schedule name (excluding lunch-specific suffix)
const [, base] = /^(.+?)(-[abc])?$/.exec(current_schedule);

Expand Down

0 comments on commit d1476f3

Please sign in to comment.