Calendar does not show events if user has different timezone than site

Created on 9 June 2023, about 1 year ago
Updated 17 September 2023, 10 months ago

Problem/Motivation

One of our users could not see any events on the calendar. It turns out her account was set to a different timezone.

Steps to reproduce

Create several events with a Smart Date field, and a Calendar View monthly view.

Set the site timezone to a local timezone.

Set the user's timezone to a different timezone.

That user will not see events on the calendar.

Proposed resolution

When the list of events is calculated from the view, the events are loaded with the user's timezone in CalendarViewBase::populateCalendar, and then set to midnight.

However, the timestamps for the date boxes were previously populated in CalendarViewMonth::buildTable, which does not use the user's timezone.

Then, later in CalendarViewBase::populateCalendar, it does an equality comparison with the two timestamps, which don't match unless they are the same timezone.

Remaining tasks

Change one or the other of these to the same timezone. Or, make the comparison match a range instead of a single timestamp.

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Fixed

Version

2.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States freelock Seattle

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024