Closed Bug 1545181 Opened 5 years ago Closed 5 years ago

The task "Due In" column sometimes shows an incorrect "0 days"

Categories

(Calendar :: Tasks, defect)

Lightning 68
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: pmorris, Assigned: pmorris)

References

Details

Attachments

(1 file, 1 obsolete file)

On current development builds, when a task's due date is:

  • on the same day of the week as today, but a week or more apart
  • is due later in the day than the current time (today)

then the "Due In" column incorrectly displays "0 days".

Version: unspecified → Lightning 7.0

The code that generates the "Due In" column string is the "duration" method in "comm/calendar/base/content/calendar-task-tree.js", around line 360.

Attached patch task-due-in-column-0.patch (obsolete) (deleted) — Splinter Review

It turns out the duration object can be like { weeks: 1, days: 0 }, so we have to convert weeks to days. For example:

6 day duration is like: { weeks: 0, days: 6 }
7 day duration is like: { weeks: 1, days: 0 }
8 day duration is like: { weeks: 0, days: 8 }

(The zeros are actually negative: -0.)

Assignee: nobody → paul
Status: NEW → ASSIGNED
Attachment #9075758 - Flags: review?(philipp)
Attached patch task-due-in-column-1.patch (deleted) — Splinter Review

Revised the comment to make it really clear what's going on.

Attachment #9075758 - Attachment is obsolete: true
Attachment #9075758 - Flags: review?(philipp)
Attachment #9075763 - Flags: review?(philipp)
Attachment #9075763 - Flags: approval-calendar-beta?(philipp)
Attachment #9075763 - Flags: review?(philipp)
Attachment #9075763 - Flags: review+
Attachment #9075763 - Flags: approval-calendar-beta?(philipp)
Attachment #9075763 - Flags: approval-calendar-beta+

Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/2a299189d890
Fix the "0 days" error in the task "Due In" column. r=philipp

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 7.1

TB 68 beta 4 / Cal 7.0 (well, just aligned that version with TB):
https://hg.mozilla.org/releases/comm-beta/rev/3355ea2d0afb1816d437f23dd53380dcc6d95926

Target Milestone: 7.1 → 7.0
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: