Closed Bug 1151011 Opened 9 years ago Closed 9 years ago

Calendar events show up on wrong day when printing

Categories

(Calendar :: Printing, defect)

Lightning 3.3
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
4.0.0.1

People

(Reporter: Stephen.Ditch, Assigned: bv1578)

References

Details

(Whiteboard: [timezone])

Attachments

(3 files, 1 obsolete file)

User Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; InfoPath.3)

Steps to reproduce:

My timezone is set to America/New York.  I create an event on a single day to start at 8PM and end at 9PM


Actual results:

The event shows up on the correct day however when going to print either the Monthly Grid or the Weekly Planner the event shows up on the following day.  


Expected results:

The issue is at 8PM Eastern time is 12AM GMT(UTC) so the event is actually considing itself on the following day.  The time shows correct on the printout but the day is not compensating for the timezone making it appear on the following day from 8PM to 9PM
I currently can't reproduce this issue. Do you have calendar.icaljs (->config editor) enabled or disabled?
Flags: needinfo?(Stephen.Ditch)
Whiteboard: [timezone]
calendar.icaljs is set to a value of false
Flags: needinfo?(Stephen.Ditch)
Attached image New Event on calendar
Created for 8pm-9pm America/New York on April 23
Only the list view shows the event on the correct day (April 23) the weekly planner and monthly grid move the event to the following day (April 24)
ics data for the calendar event (April 23 from 8pm to 9pm America/New York)

BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
BEGIN:VEVENT
CREATED:20150413T125116Z
LAST-MODIFIED:20150413T125154Z
DTSTAMP:20150413T125154Z
UID:2caf0f7c-9b33-4e64-b7a9-7da46e965646
SUMMARY:New Event
PRIORITY:5
DTSTART:20150424T000000Z
DTEND:20150424T010000Z
SEQUENCE:0
X-MICROSOFT-CDO-BUSYSTATUS:BUSY
END:VEVENT
END:VCALENDAR
Also able to replicate this issue with with Thunderbird 38.0 beta 3 with Lightning 4.0b3
I can confirm this behavior but I think it has already been reported before, though I'm not able to find a previous bug.

To reproduce:
- set the timezone in Lightning to America/New York;
- import the calendar in comment 5;
- display the print dialog with the Weekly Planner layout and set the Custom date range in the week with the event.

It is caused by the fact that the day boxes in the Weekly layout have the default timezone (America/New york), instead the events are placed inside the day with their own timezone (UTC) but show the start/end time with the default timezone.
Assignee: nobody → bv1578
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attached patch patch - v1 (obsolete) — Splinter Review
The boxDateKey variable gets a wrong value and the items get placed in wrong position inside the dayTable without the timezone correction.
Attachment #8604532 - Flags: review?(philipp)
(In reply to Decathlon from comment #9)
> Created attachment 8604532 [details] [diff] [review]
> patch - v1
> 
> The boxDateKey variable gets a wrong value and the items get placed in wrong
> position inside the dayTable without the timezone correction.

I can confirm the patch worked correctly on Thunderbird 24.2.0 with Lightning 2.6.4. for the Weekly Planner.  A similar change will also need to be done with calMonthGridPrinter.js as the Monthly Grid has the same original issue.

I will next test the patch on Thunderbird 38.0b4 with Lightning 4.0b3
Comment on attachment 8604532 [details] [diff] [review]
patch - v1

(In reply to Stephen.Ditch from comment #10)
>  A similar change will also need to
> be done with calMonthGridPrinter.js as the Monthly Grid has the same
> original issue.

You are right, I will attach an updated patch.
Attachment #8604532 - Flags: review?(philipp)
For some reason I can't get the same patch to work with Thunderbird 38.0b4 with Lightning 4.0b4.  The calendar events after 8pm are showing up on the following day.  Patch worked perfect on 24.2.0 with Lightning 2.6.4, strange.
(In reply to Stephen.Ditch from comment #12)
> For some reason I can't get the same patch to work with Thunderbird 38.0b4
> with Lightning 4.0b4.  The calendar events after 8pm are showing up on the
> following day.  Patch worked perfect on 24.2.0 with Lightning 2.6.4, strange.

Correction, the patch DOES work on Thunderbird 38.0b4 with Lightning 4.0b4.  There was some confusion with the new integration of Lightning in the distribution\extensions folder as this copied the pre-patched calWeekPrinter.js to the profile.  Once I copied the updated file to the individual profile, it functioned correctly.
Attached patch patch-v2Splinter Review
The monthly grid needs exactly the same adjustment about timezones.
Attachment #8604532 - Attachment is obsolete: true
Attachment #8606711 - Flags: review?(philipp)
Attachment #8606711 - Flags: review?(philipp) → review+
Comment on attachment 8606711 [details] [diff] [review]
patch-v2

Review of attachment 8606711 [details] [diff] [review]:
-----------------------------------------------------------------

I'm also fine taking this for beta, if we are quick.
Attachment #8606711 - Flags: approval-calendar-beta+
Attachment #8606711 - Flags: approval-calendar-aurora+
Tested patch-v2 on Thunderbird 38.0b4 with Lightning 4.0b4, and events after 8PM on both the Monthly Grid and Weekly Planner are displaying on the correct day!  Thanks!
Pushed to comm-central changeset bf2473395e2b
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 4.3
Backported to releases/comm-beta changeset 05001d19f200 (THUNDERBIRD_38_VERBRANCH)
Target Milestone: 4.1 → 4.0
You need to log in before you can comment on or make changes to this bug.