Skip to content

Migrate schedule.json to TOML - #290

Merged
psvenk merged 2 commits into
masterfrom
schedule-toml
Apr 10, 2021
Merged

psvenk merged 2 commits into
masterfrom
schedule-toml

Conversation

@psvenk

@psvenk psvenk commented Apr 7, 2021

Copy link
Copy Markdown
Member

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
Copy Markdown
Collaborator

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

@tektaxi tektaxi left a comment

Copy link
Copy Markdown
Collaborator

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

psvenk commented Apr 10, 2021

Copy link
Copy Markdown
Member Author

@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?

Comment thread 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]

Copy link
Copy Markdown
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
Copy Markdown
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