-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix period numbering under clock #242
Conversation
Write a conditional to check whether a schedule includes a "before school" class, as well as to align the black and silver day schedules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to work with my schedule, but it seems a bit hacky. Instead of computing an index using the period number (Number(default_name.charAt(default_name.length - 1))
), we could just compare the last character of default_name
with the last character of each entry of period_names[bs_day]
(for (const { name } of period_names[bs_day]) { ... }
, for example). If there is a match, then we can assume that this is the correct period and return the name; if no match, then just return the default_name
. This way, we don't have to special-case "Before School" (AM) classes, we don't need to assume that they all have the words "Before School" in the title, we don't have separate logic for black and silver days, and the code is overall a lot simpler. Your thoughts?
@psvenk Yes, that's a better idea. |
Fix period numbering under small clock by using the current period rather than detecting AM classes.
@psvenk This should work, and it doesn't rely on detecting before school classes. |
Remove the superfluous "Period: " before period names; remove special-casing for "Community Meeting" (which anyway is not enforced due to the change to "CM/ADV"); simplify get_period_name; fix indentation rule for clock.js in .editorconfig
Change some code so that it does not assume that the periods are the same for black days as for silver days.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jadebuckwalter I made a few changes; do you think this is ready to merge now?
Write a conditional to check whether a schedule includes a "before
school" class, as well as to align the black and silver day schedules.