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

Blocks: Improve date display for schedule & sessions across timezones #696

Merged
merged 4 commits into from
Sep 17, 2021

Conversation

ryelle
Copy link
Contributor

@ryelle ryelle commented Sep 14, 2021

This PR iterates on how dates & times are displayed in the blocks.

  1. Update the schedule block to use format, which will use the client's timezone to do all session-grouping, layout, and display. This ensures the schedule is always showing the viewers timezone, which makes more sense for online and regional WordCamps.
  2. Prefix the grid rules with the numeric date. This fixes the issue in Sessions in schedule block overlap when viewing from certain locations/timezones #562, which happened because the last session ended at 12:10 the following day, while the first session started at 12:10 -- this created 2 rules in the grid-template-rows for time-0010, but only the first was valid. The session spanned from that first start time to it's real start time, functionally the entire "day".
  3. Add timezone strings to the sessions in the session and speaker blocks - this is more of a workaround, since these are rendered by PHP and we don't know the client timezone, but it's a small improvement.

Fixes #562, fixes #565, fixes #492.

Note: I'm not sure if we could consider this as fixing 565 - once this PR is applied, it should be the case that session times are always either your (viewer's) time, or has a timezone identifier. Now that the schedule time also has a TZ displayed, it should always be clear what timezone you're seeing.

Screenshots

Schedule block use the viewer's timezone. My browser timezone is EDT, the site's timezone is PDT. The sessions start at 8:00 am PDT. On the left is Safari, which shows production, showing the ambiguous "8:00am" start time. On the right is Firefox showing my sandbox, correctly showing "11:00am". (it's still ambiguous, but most people will assume local time. Organizers can add a note above the schedule)

Screen Shot 2021-09-14 at 12 47 41 PM

Session overlapping (#562):

schedule-overlap@0 5x

Sessions with timezones

Screen Shot 2021-09-14 at 7 24 05 PM

How to test the changes in this Pull Request:

  1. Set up sessions and a schedule, pay attention to your site's timezone
  2. View the schedule from various timezones, the schedule should reflect your current TZ.
  3. View the speakers & sessions blocks with dates showing, they should include the site's timezone

`wp.date.format` will respect the client's timezone, and show the date in the viewer's timezone. The current `dateI18n` approach always uses the site timezone, which can be confusing for regional and online events.
In some cases, if a session spans later than midnight and ends at the same time as an earlier timeslot, it can cause the sessions to overlap because the grid slot is already defined. Prepending the date fixes this, since separate days have separate grid systems.
This is mostly a workaround, instead of showing the user's time, but it's an improvement
@ryelle ryelle added the [Component] Blocks All custom blocks (Speakers, CrowdCast, Live Schedule, etc) label Sep 14, 2021
@ryelle ryelle self-assigned this Sep 14, 2021
Copy link
Member

@iandunn iandunn left a comment

Choose a reason for hiding this comment

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

LGTM overall 👍🏻

I think the Schedule block should have the TZID too, though; otherwise I worry the ambiguity will confuse some folks.

  • folks who are out of town could setup calendar reminders before they travel, and end up putting the incorrect times, and miss sessions.
  • some contributors are used to the times being local, and will assume that they still are unless they see something to indicate otherwise

I think the TZID on all the blocks should also link to something like timeanddate.com, so people can easily convert between zones when needed.

@ryelle
Copy link
Contributor Author

ryelle commented Sep 16, 2021

Yeah, that makes sense. I've added it to the row heading, but I think putting it on the times in the session cells would be too verbose, so it looks like this now:

Screen Shot 2021-09-16 at 2 03 09 PM

As for linking to a 3rd party time conversion site, I think that might also get visually overwhelming - to have so many links in the schedule. If you feel strongly about it, can you open another issue for that so we can discuss it there?

@iandunn
Copy link
Member

iandunn commented Sep 16, 2021

putting it on the times in the session cells would be too verbose

👍🏻

linking to a 3rd party time conversion site [...] might also get visually overwhelming

👍🏻 - #698

@ryelle ryelle merged commit e6072a6 into production Sep 17, 2021
@ryelle ryelle deleted the try/block-schedule-format-date branch September 17, 2021 15:17
ryelle added a commit that referenced this pull request Sep 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Component] Blocks All custom blocks (Speakers, CrowdCast, Live Schedule, etc)
Projects
None yet
2 participants