-
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
Migrate schedule.json to TOML #290
Conversation
This helps readability and maintainability considerably. Some changes have been made to the frontend to work with native JavaScript Date objects instead of numbers.
Can you add an error throw as a default case in the switch statement on line 178 of clock.js? |
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.
Works fine for me, but I haven't looked through the code much.
public/js/clock.js
Outdated
for (const [, schedule] of Object.entries(schedules)) { | ||
for (entry of schedule) { | ||
// Convert each entry to a JavaScript Date object | ||
let [, hours, minutes, seconds, ms] |
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.
Can you avoid this regex repeat?
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.
Fixed in 2571fc5.
Avoid repeating the regex for extracting components from a time, and make this part of the code more concise in general.
Closes #253. This helps readability and maintainability considerably. Some changes have been made to the frontend to work with native JavaScript
Date
objects instead of numbers.