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

Add times to the schedule #283

Merged
merged 3 commits into from
Mar 24, 2021
Merged

Add times to the schedule #283

merged 3 commits into from
Mar 24, 2021

Conversation

jadebuckwalter
Copy link
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
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
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 well for me!

Copy link
Member

@psvenk psvenk left a comment

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.
Copy link
Member

@psvenk psvenk left a comment

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

psvenk commented Mar 24, 2021

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

@jadebuckwalter
Copy link
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).
Copy link
Member

@psvenk psvenk left a comment

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