Opened 15 years ago
Closed 15 years ago
#924 closed defect (fixed)
date.toRelativeString can return "0 days ago"
Reported by: | Owned by: | anonymous | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Core | Version: | 0.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
date.toRelativeString contains the following snippet:
} else if(diff < 3600*24 && date.getDay() == now.getDay()) { diff = Math.round(diff/3600); return diff + " hour" + (diff == 1 ? "" : "s") + end; } else if(diff < 3600*24*7) { diff = Math.round(diff/(3600*24)); if(diff == 1) { return future ? "Tomorrow" : "Yesterday"; } else { return diff + " days" + end; } }
I'm not sure why "date.getDay() == now.getDay()" is necessary. In any case, it leads to the "0 days ago" string, which is clearly sub-optimal.
Note: See
TracTickets for help on using
tickets.
Fixed.