Closed Bug 289746 Opened 20 years ago Closed 20 years ago

Day view splits long events at midnight Amsterdam time. [trunk]

Categories

(Calendar :: Sunbird Only, defect)

defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gekacheka, Assigned: mostafah)

Details

(Keywords: regression)

Attachments

(3 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.7) Gecko/20050406 Firefox/1.0.3
Build Identifier: trunk

Day view splits long events into two boxes at midnight Amsterdam time.

Reproducible: Always

Steps to Reproduce:
1. Set OS timezone to something with an offset different from Amsterdam time.
2. Create a long event that cross midnight Amsterdam time.
3.

Actual Results:  
The event will be shown as two boxes, and the title will appear twice, once at
its normal time, and once at midnight Amsterdam time.

Expected Results:  
The event is shown as one box.

Looks like cause is at calendarWindow createEventBox:
http://lxr.mozilla.org/seamonkey/source/calendar/resources/content/calendarWindow.js#721
Keywords: regression
OS: Linux → All
(patch -l -p 2 -i file.patch)

This patch comments out the hardcoded Amsterdam timezone.
CreateEventBox will take the default branch so it works based on current OS
timezone.
Attachment #180224 - Flags: first-review?(mvl)
(patch -l -p 2 -i file.patch)

The first patch causes date view to display events with the wrong timezone
offset.

The problem is that startDate is created with UTC timezone at the
createEventBox default/unknown timezone branch, so getting the
starDate.jsDate.getHours() will be different from startDate.hour in most
timezones.  (JavaScript Date is always relative to the current OS timezone.)

This patch corrects the problem by fixing the reference to
startDate.jsDate.getHours() to be startDate.hour.
Attachment #180225 - Flags: first-review?(mvl)
(patch -l -p 2 -i file.patch)

Efficiency patch: create each .jsDate just once, rather than many times.
It looks like each reference of the property creates and initilizes a new Date
object.
http://lxr.mozilla.org/seamonkey/source/calendar/base/src/calDateTime.cpp#457
Attachment #180227 - Flags: first-review?(mvl)
Comment on attachment 180224 [details] [diff] [review]
calendarWindow.js patch: comment out amsterdam timezone

I should have done it like this in the first place. checked in.
Attachment #180224 - Flags: first-review?(mvl) → first-review+
Comment on attachment 180225 [details] [diff] [review]
dayView.js patch: fix startDate.jsDate.getHours() to startDate.hour (jsDate in different timezone)

checked in this patch.
Attachment #180225 - Flags: first-review?(mvl) → first-review+
Attachment #180227 - Flags: first-review?(mvl) → first-review+
all patched checked in.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
QA Contact: gurganbl → sunbird
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: