Skip to content
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

Merged
merged 2 commits into from
Apr 10, 2021
Merged

Migrate schedule.json to TOML #290

merged 2 commits into from
Apr 10, 2021

Conversation

psvenk
Copy link
Member

@psvenk psvenk commented Apr 7, 2021

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.

@psvenk psvenk added this to the 2.8.0 milestone Apr 8, 2021
This helps readability and maintainability considerably. Some changes
have been made to the frontend to work with native JavaScript Date
objects instead of numbers.
@psvenk psvenk requested review from notrodes and tektaxi April 10, 2021 16:39
@notrodes
Copy link
Collaborator

Can you add an error throw as a default case in the switch statement on line 178 of clock.js?

Copy link
Collaborator

@tektaxi tektaxi left a 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.

@psvenk
Copy link
Member Author

psvenk commented Apr 10, 2021

@notrodes Are you referring to the update_lunch function? That is currently dormant code which will be addressed in #95 / #288 and is out of scope here. Are there any issues with the code that I wrote/touched in this pull request, or is this ready to merge?

for (const [, schedule] of Object.entries(schedules)) {
for (entry of schedule) {
// Convert each entry to a JavaScript Date object
let [, hours, minutes, seconds, ms]
Copy link
Collaborator

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?

Copy link
Member Author

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.
@psvenk psvenk requested a review from notrodes April 10, 2021 17:26
@psvenk psvenk merged commit 4807eae into master Apr 10, 2021
@psvenk psvenk deleted the schedule-toml branch April 10, 2021 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve formatting of schedule.json
3 participants