Last Comment Bug 1151011 - Calendar events show up on wrong day when printing
: Calendar events show up on wrong day when printing
Status: RESOLVED FIXED
[timezone]
:
Product: Calendar
Classification: Client Software
Component: Printing (show other bugs)
: Lightning 3.3
: All All
-- normal (vote)
: 4.0.0.1
Assigned To: Decathlon
:
:
Mentors:
: 1163123 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-04-03 12:44 PDT by Stephen.Ditch
Modified: 2015-05-19 06:18 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
New Event on calendar (10.87 KB, image/jpeg)
2015-04-13 05:59 PDT, Stephen.Ditch
no flags Details
newevent-calendarprintviews.png (26.49 KB, image/png)
2015-04-13 06:01 PDT, Stephen.Ditch
no flags Details
patch - v1 (1.33 KB, patch)
2015-05-12 01:22 PDT, Decathlon
no flags Details | Diff | Splinter Review
patch-v2 (2.49 KB, patch)
2015-05-17 01:08 PDT, Decathlon
philipp: review+
philipp: approval‑calendar‑aurora+
philipp: approval‑calendar‑beta+
Details | Diff | Splinter Review

Description User image Stephen.Ditch 2015-04-03 12:44:12 PDT
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
Comment 1 User image [:MakeMyDay] 2015-04-12 11:36:43 PDT
I currently can't reproduce this issue. Do you have calendar.icaljs (->config editor) enabled or disabled?
Comment 2 User image Stephen.Ditch 2015-04-13 05:21:59 PDT
calendar.icaljs is set to a value of false
Comment 3 User image Stephen.Ditch 2015-04-13 05:59:32 PDT
Created attachment 8591636 [details]
New Event on calendar

Created for 8pm-9pm America/New York on April 23
Comment 4 User image Stephen.Ditch 2015-04-13 06:01:30 PDT
Created attachment 8591637 [details]
newevent-calendarprintviews.png

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)
Comment 5 User image Stephen.Ditch 2015-04-13 06:02:16 PDT
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
Comment 6 User image Stephen.Ditch 2015-05-04 06:39:36 PDT
Also able to replicate this issue with with Thunderbird 38.0 beta 3 with Lightning 4.0b3
Comment 7 User image Decathlon 2015-05-09 00:46:56 PDT
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.
Comment 8 User image Decathlon 2015-05-09 08:48:05 PDT
*** Bug 1163123 has been marked as a duplicate of this bug. ***
Comment 9 User image Decathlon 2015-05-12 01:22:03 PDT
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.
Comment 10 User image Stephen.Ditch 2015-05-12 06:10:49 PDT
(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 11 User image Decathlon 2015-05-12 06:37:49 PDT
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.
Comment 12 User image Stephen.Ditch 2015-05-12 12:21:59 PDT
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.
Comment 13 User image Stephen.Ditch 2015-05-12 12:46:17 PDT
(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.
Comment 14 User image Decathlon 2015-05-17 01:08:13 PDT
Created attachment 8606711 [details] [diff] [review]
patch-v2

The monthly grid needs exactly the same adjustment about timezones.
Comment 15 User image Philipp Kewisch [:Fallen] 2015-05-17 13:25:41 PDT
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.
Comment 16 User image Stephen.Ditch 2015-05-18 04:36:01 PDT
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!
Comment 17 User image Philipp Kewisch [:Fallen] 2015-05-19 05:38:41 PDT
Pushed to comm-central changeset bf2473395e2b
Comment 18 User image Philipp Kewisch [:Fallen] 2015-05-19 05:41:16 PDT
Backported to releases/comm-aurora changeset 10ff342eb381
Comment 19 User image Philipp Kewisch [:Fallen] 2015-05-19 05:56:37 PDT
Backported to releases/comm-beta changeset 3450fc9588a9
Comment 20 User image Philipp Kewisch [:Fallen] 2015-05-19 06:18:20 PDT
Backported to releases/comm-beta changeset 05001d19f200 (THUNDERBIRD_38_VERBRANCH)

Note You need to log in before you can comment on or make changes to this bug.