Week and Month View ALWAYS uses UTC time zone for displaying boundries

Bug #80055 reported by Randall Ribaudo
34
Affects Status Importance Assigned to Milestone
SchoolTool
Fix Released
High
Unassigned

Bug Description

I set my calendar to use the Eastern Time zone. If I schedule any event to go beyond 8pm, in the month
view the event now spans over to the next day. It appears that in determining the daily boundries for the
Week and Month view (only) it is reverting to the UTC default time zone, which is 4 hours later than
Eastern/US. So anything after 8pm Eastern is calculated to be the next day in UTC. This is counter-
intuitive behavior, and not what is seen in the daily view (which correctly shows the timespan.

Revision history for this message
Marius Gedminas (mgedmin) wrote :

Confirming this bug.

There are two closely related issues: issue 380 and issue 383.

Revision history for this message
Marius Gedminas (mgedmin) wrote :

Also, beware of using a_datetime.replace(tzinfo=foo) or datetime.combine(a_date,
time(tzinfo=foo)) -- it will give incorrect results:

  >>> vilnius = pytz.timezone('Europe/Vilnius')
  >>> datetime.datetime(2005, 9, 26, 20, 0, tzinfo=vilnius)
datetime.datetime(2005, 9, 26, 20, 0, tzinfo=<DstTzInfo 'Europe/Vilnius'
WMT+1:24:00 STD>)
  >>> print _.astimezone(pytz.utc)
  2005-09-26 18:36:00+00:00

Use tzinfo.localize(naive_datetime) instead.

I have found a lot of places in src/schooltool/app/browser/cal.py that might be
incorrect -- they will need unit tests for corner cases.

I also do not trust parse_timetz in src/schooltool/calendar/utils.py. Since it
is not used, I suggest removing it.

Revision history for this message
Randall Ribaudo (rkr-comcast) wrote :
Download full text (3.2 KiB)

If it will help, I've also noticed that even if I set the timezone in Schoolbell to US/Eastern, and then add
events, the iCAL file that it publishes when I click "Open in iCAL" does not have the appropriate
information to specify US/Eastern time zone. It's as if it completely ignores the timezone setting.

 In fact, the datestamps have the letter "Z" appended to them which is the format for UTC time (for a
good paper on standard iCAL formatting see this link: http://www.ietf.org/rfc/rfc2445.txt.

Below is the printout of the short iCAL file generated by Schoolbell 1.2.2. The events are named for the
original Eastern Time I entered them at in Schoolbell: so the lines:

BEGIN:VEVENT
UID:<email address hidden>
SUMMARY:11 AM Eastern Time
DTSTART:20051007T150000Z
DURATION:PT1H
DTSTAMP:20051007T194747Z
END:VEVENT

You can see the "Z" at the end of the time stamp, and no indication of the Eastern timezone (the
SUMMARY field is the name of the event I gave it which was appropriately named "11 AM Eastern Time".
The entire file is below.

Below the schoolbell-generated file is the same calendar entries generated by iCAL on the Mac. Notice
that the event start times are designated using the appropriate time zone indications:

BEGIN:VEVENT
DTSTART;TZID=US/Eastern:20051007T110000
SUMMARY:11 AM Eastern Time

The entire file is listed below the Schoolbell version.

THIS IS THE iCAL FILE GENERATED BY SCHOOLBELL 1.2.2

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//SchoolTool.org/NONSGML SchoolBell//EN
BEGIN:VEVENT
UID:<email address hidden>
SUMMARY:11 AM Eastern Time
DTSTART:20051007T150000Z
DURATION:PT1H
DTSTAMP:20051007T194747Z
END:VEVENT
BEGIN:VEVENT
UID:<email address hidden>
SUMMARY:6-10PM Eastern Time
DTSTART:20051007T220000Z
DURATION:PT4H
DTSTAMP:20051007T194747Z
END:VEVENT
BEGIN:VEVENT
UID:<email address hidden>
SUMMARY:2PM Eastern Time
DTSTART:20051007T180000Z
DURATION:PT1H
DTSTAMP:20051007T194747Z
END:VEVENT
END:VCALENDAR

iCAL GENERATED FROM iCAL on Macintosh G5 using Panther 10.4.2

BEGIN:VCALENDAR
VERSION:2.0
X-WR-CALNAME:calendar-2
PRODID:-//Apple Computer\, Inc//iCal 2.0//EN
X-WR-RELCALID:083C1830-AE49-4892-A142-327CADB3ECFB
X-WR-TIMEZONE:US/Eastern
CALSCALE:GREGORIAN
METHOD:PUBLISH
BEGIN:VTIMEZONE
TZID:US/Eastern
LAST-MODIFIED:20051007T195604Z
BEGIN:DAYLIGHT
DTSTART:20050403T070000
TZOFFSETTO:-0400
TZOFFSETFROM:+0000
TZNAME:EDT
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:20051030T020000
TZOFFSETTO:-0500
TZOFFSETFROM:-0400
TZNAME:EST
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:20060402T010000
TZOFFSETTO:-0400
TZOFFSETFROM:-0500
TZNAME:EDT
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
DTSTART;TZID=US/Eastern:20051007T180000
SUMMARY:6-10PM Eastern Time
UID:8E5DEFB0-96A9-419E-BC26-F203CB52A2D7
DTSTAMP:20051007T195542Z
SEQUENCE:2
DURATION:PT4H
END:VEVENT
BEGIN:VEVENT
DTSTART;TZID=US/Eastern:20051007T110000
SUMMARY:11 AM Eastern Time
UID:726C154E-85AD-4ED2-A47E-B70D9E8B747D
DTSTAMP:20051007T195503Z
SEQUENCE:7
DURATION:PT1H
END:VEVENT
BEGIN:VEVENT
DTSTART;TZID=US/Eastern:20051007T140000
SUMMARY:2PM Eastern Time
U...

Read more...

Revision history for this message
Brian Skahan (bskahan-deactivatedaccount) wrote :

should be fixed in r5298

Revision history for this message
Ignas Mikalajūnas (ignas) wrote :

Fixed in rev 5950.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.