Repository navigation
Add day-of-week picker - #257
Conversation
|
Though the basic functionality has been implemented, this is still a work in progress. This is what remains:
|
psvenk
left a comment
There was a problem hiding this comment.
Thanks for the changes. While we should have a day-of-week dropdown, I am still wary of completely refactoring the code to rely on the day of the week and ditching black and silver days altogether, given that we will probably go back to a black/silver-based schedule post-covid. Many parts of the code use conditionals so that we can easily revert to the pre-covid behavior at any time.
Is there any technical reason why this refactoring is necessary, or would it be feasible to continue having the day of the week be used to compute whether it's a black or silver day as well as which schedule from schedule.json to use (covid-mt, covid-w, or covid-rf)? The main change would be that instead of directly using now.getDay() in those places, we could have a global variable day and do something like day || now.getDay() so that day, if set, overrides now. (We would also need some code using something like new Date().getDay() to set the dropdown to default to the current day of the week.)
Add a dropdown above the schedule to select the day of the week, and update the schedule to match that day.
Instead of using days of the week directly, use black and silver days
ee586af to
ea64436
Compare
Rather than setting an inconsequential local variable, set a new global variable for the day of week and make this control the clock.
Introduce a new function which reformats the schedule in the mold of the specifications in schedule.json which outline the order of periods, meaning that the schedule now displays the periods in the proper order, including periods that do not have a class associated with them, according to the day of the week (and, post-covid, whether a student has lunch A, lunch B, or lunch C).
Add after-school classes to schedule.json so that they are displayed once again in the schedule tab, but give them a close-to-zero timeframe so that they are excluded from the clock (because there is no standardized meeting time for these classes).
Respect the value of the day-of-week dropdown and the date override throughout redraw_clock.
psvenk
left a comment
There was a problem hiding this comment.
@jadebuckwalter, @tektaxi, and I have agreed that the styling can be addressed in a separate pull request, so this is ready to merge.
Add a dropdown above the schedule to select the day of the week, and
update the schedule to match that day.