Closed Bug 787357 Opened 12 years ago Closed 12 years ago

Print Preview shows "All day - All day" for allday events

Categories

(Calendar :: Printing, defect)

Lightning 1.7
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Fallen, Assigned: ssitter)

References

()

Details

(Keywords: regression)

Attachments

(1 file)

Noticed this by two reporters from the blog. For all day events the print preview incorrectly shows the interval for all day events.
Caused here:
> http://mxr.mozilla.org/comm-central/source/calendar/base/modules/calPrintUtils.jsm#90
> let itemInterval = cal.getDateFormatter().formatItemTimeInterval(item);

This will always create a string like "starttime-endtime", i.e. "All Day-All Day" for an all day event. Previously there was more logic used to determine the correct format.
Blocks: 757902
In our case, it is the printing (monthly view) that show this behavior and it is a regression from the previous version we were using. A 3 days recurring all day event will print only on the first day as: "All Day-All Day Event name".

A fix would be appreciated. Thanks...
Rene, the second part of your problem is filed as bug 787537.
Stefan,

Thanks for pointing me to the existing problem. Sorry I did not find it when I looked yesterday...
Assignee: nobody → ssitter
Status: NEW → ASSIGNED
Attachment #658938 - Flags: review?(philipp)
Attachment #658938 - Flags: approval-calendar-beta?
Attachment #658938 - Flags: approval-calendar-aurora?
Comment on attachment 658938 [details] [diff] [review]
regression fix (omit time for all-day items like in Lightning 1.6)

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

::: calendar/base/modules/calPrintUtils.jsm
@@ +164,5 @@
> +            return "";
> +        }
> +
> +        // Bug 787537: will result in wrong time label for events that span two or more days
> +        return cal.getDateFormatter().formatItemTimeInterval(aItem);

Hmm tough call. My original thought was that it makes more sense to fix this in the date time formatter, but if we always return a blank string there this might not be wanted in other places.

I see two options:

1. Keep the patch like it is (r=philipp for that)
2. Check other callers of formatItemTimeInterval() to see if an empty string makes sense there too and move this code into the formatter.

Let me know what you think
Attachment #658938 - Flags: review?(philipp)
Attachment #658938 - Flags: review+
Attachment #658938 - Flags: approval-calendar-beta?
Attachment #658938 - Flags: approval-calendar-beta+
Attachment #658938 - Flags: approval-calendar-aurora?
Attachment #658938 - Flags: approval-calendar-aurora+
I think I'll go with pushing the patch as is for now to fix the current problem.

calDateTimeFormatter::formatItemTimeInterval() is only called once in calPrintUtils.jsm, therefore it might be possible to move the all day logic into it. We still need to work on this to fix the wrong times printed for multi day events. We can use Bug 359007 for this.
Pushed to https://hg.mozilla.org/comm-central/rev/601fc607aaf9
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.0
Pushed to https://hg.mozilla.org/releases/comm-aurora/rev/9a8111084ff8
Target Milestone: 2.0 → 1.9
Pushed to https://hg.mozilla.org/releases/comm-beta/rev/39fbe678702a
Target Milestone: 1.9 → 1.8
You need to log in before you can comment on or make changes to this bug.