Repository navigation
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.
psvenk
left a comment
There was a problem hiding this comment.
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.
psvenk
left a comment
There was a problem hiding this comment.
@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.