Skip to content

Add times to the schedule - #283

Merged
jadebuckwalter merged 3 commits into
masterfrom
schedule-times
Mar 24, 2021
Merged

jadebuckwalter merged 3 commits into
masterfrom
schedule-times

Conversation

@jadebuckwalter

Copy link
Copy Markdown
Collaborator

For each period, display the start and end time in the schedule.

For each period, display the start and end time in the schedule.
@jadebuckwalter

Copy link
Copy Markdown
Collaborator Author

It would be great if someone who doesn't have an AM class could test this out.

@jadebuckwalter jadebuckwalter linked an issue Mar 24, 2021 that may be closed by this pull request
@psvenk
psvenk self-requested a review March 24, 2021 20:29
@jadebuckwalter jadebuckwalter added this to the 2.7.1 milestone Mar 24, 2021

@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 well for me!

@psvenk psvenk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not work for me. I am working on a fix.

Finding the time for a period is independent of the periods in a
student's schedule because the start and end times are in schedule.json;
also, remove usage of the comma operator.

@psvenk psvenk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just now refactored the code so that it is more efficient and clean and also works on my schedule, so it looks good to me apart from some stylistic comments: (a) we should display "AM"/"PM" instead of just leaving it implied (we can add a 24-hour time option once #23 is implemented), and (b) an en dash (–) should be used between times, not a hyphen (see Butterick's Practical Typography).

@psvenk

psvenk commented Mar 24, 2021

Copy link
Copy Markdown
Member

By the way, the time formatting can be handled by Date.prototype.toLocaleTimeString. A fix is underway.

@jadebuckwalter

Copy link
Copy Markdown
Collaborator Author

@psvenk Great - that seems a lot easier. I can take care of these fixes if you'd like.

This not only resolves ambiguity arising from 12-hour time without "AM"
or "PM" but also localizes the time format (so that, e.g., 24-hour time
will be used when the locale specifies it).

@psvenk psvenk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@jadebuckwalter

Copy link
Copy Markdown
Collaborator Author

Looks good to me as well.

@jadebuckwalter
jadebuckwalter merged commit d45b3c1 into master Mar 24, 2021
@jadebuckwalter
jadebuckwalter deleted the schedule-times branch March 24, 2021 21:37
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.

Display period times in schedule

3 participants