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

Inaccurate date/time in interface #19

Open
ner00 opened this issue Apr 27, 2021 · 2 comments
Open

Inaccurate date/time in interface #19

ner00 opened this issue Apr 27, 2021 · 2 comments

Comments

@ner00
Copy link

ner00 commented Apr 27, 2021

Roundcube correctly detects my timezone as GMT+00:00 (Europe/London), the VCalendar entries are grabbed correctly but then the interface shows the wrong date/time for event start/end. Here's an example:

BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
DTSTART;TZID=GMT Standard Time:20210428T090000
DTEND;TZID=GMT Standard Time:20210428T093000

Interface shows this as being scheduled from 10:00 to 10:30 (essentially adding +01:00 for no reason), but in the database it's correctly recorded as starting at 2021-04-28 09:00:00 and ending at 2021-04-28 09:30:00

Should I look somewhere in specific to fix this?

@ner00
Copy link
Author

ner00 commented Apr 27, 2021

function adjust_timezone from libcalendaring seems to be what's being used to incorrectly offset the time for me:
$dt->setTimezone($this->timezone);
Commenting the function keeps the correct time in the calendar overview but not in the detail (edit) window.

The code seems fine though, as does the content of $this->timezone

[timezone_type] => 3
[timezone] => Europe/London

In any case, there must be some reason why the date/time and timezone is fine everywhere but the event time still gets offset forward by 1 hour in the calendar view.

@ner00
Copy link
Author

ner00 commented Apr 27, 2021

Okay, so the problem seems two-fold:

  1. There is no DST awareness when the date/time is fed to adjust_timezone. The VCALENDAR entry has an explicit timezone of GMT, but no DST information. Not sure if that would be a standard piece of information or not.
  2. Beside no DST information, the entry's timzeone is sent incorrectly, I guess, since it should be GMT yet this is the content of $dt object sent to adjust_timezone function:
[date] = > "2021-04-28 09:00:00.000000"
[timezone_type] => 3
[timezone] => "UTC"

Because it receives UTC and/or no DST information, adjust_timezone will add the DST offset (+01:00) to an already DST-based timestamp. The event's start/end date, time, timezone, DST should all be validated before being passed on to adjust_timezone.

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

No branches or pull requests

1 participant