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

Dynamic schedule timezones #704

Merged
merged 5 commits into from Oct 2, 2020
Merged

Dynamic schedule timezones #704

merged 5 commits into from Oct 2, 2020

Conversation

martey
Copy link
Contributor

@martey martey commented Oct 2, 2020

  • Update database to be more timezone-aware.
  • Add ability for users to change the displayed timezone on schedule pages.

Because this pull request makes significant changes to the database and the design of the schedule pages, it should not be applied to finished conferences.

Remove timezone field from Conference model, since it is not used by a
conference's schedule (the timezone is determined by the Django's
project timezone - see the TIME_ZONE setting).

Note that the "django-timezone-field" package is **not** removed from
the requirements file in this commit because some current conference
sites are using it for speaker timezone fields (see
#576 and
#596).
Convert "start" and "end" fields in Slots from TimeFields to
DateTimeFields so that they can include timezone information.
  - Add new `time_zone_context` context processor that replaces and
    extends `django.template.context_processors.tz`. It adds both the
    current time zone and a list of common time zones to the context.
  - Add middleware to set a user's time zone based on information stored
    in their session.
  - Add form and view to allow users to select a new time zone.
Use day of week based on presentation slot start datetime, not on
presentation slot day.
@martey martey self-assigned this Oct 2, 2020
@codeclimate
Copy link

codeclimate bot commented Oct 2, 2020

Code Climate has analyzed commit 92044a4 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 90.6% (50% is the threshold).

This pull request will bring the total coverage in the repository to 76.5% (0.0% change).

View more on Code Climate.

@martey martey merged commit a2dcfcb into master Oct 2, 2020
@martey martey deleted the dynamic-schedule-timezones branch October 2, 2020 01:58
@jasongrout
Copy link

Just curious, does this use the browser timezone information to make an intelligent guess about the right timezone?

I'm excited to see how it handles conference "days" that are now split over two days in a different timezone.

@jasongrout
Copy link

jasongrout commented Oct 2, 2020

For example, apparently the js code Intl.DateTimeFormat().resolvedOptions().timeZone does a pretty decent job of returning the current timezone - if none is set, perhaps it can be the default rather than the conference timezone?

@martey
Copy link
Contributor Author

martey commented Oct 2, 2020

FYI: This isn't deployed on the JupyterCon site because I have found an issue with converting existing schedules that I am currently troubleshooting.

Just curious, does this use the browser timezone information to make an intelligent guess about the right timezone?

No, this uses the conference server's time zone as the default. Since the user-selected time zone is stored in the session, though, conference attendees should not have re-select their preferred time zone each time they visit the site.

I'm excited to see how it handles conference "days" that are now split over two days in a different timezone.

This pull request does not explicitly deal with that. While choosing a different time zone will show you the local date and time that a presentation is happening on the schedule, it will not change the schedule day that the presentation is associated with.

@jasongrout
Copy link

This pull request does not explicitly deal with that. While choosing a different time zone will show you the local date and time that a presentation is happening on the schedule, it will not change the schedule day that the presentation is associated with.

That sounds fine - the conference still has "days", but the time on the left in the schedule shows you the local time (including day)?

@martey
Copy link
Contributor Author

martey commented Oct 2, 2020

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.

None yet

2 participants