Opened 13 years ago

Closed 13 years ago

#924 closed defect (fixed)

date.toRelativeString can return "0 days ago"

Reported by: tim@… 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.

Change History (1)

comment:1 Changed 13 years ago by Tom Trenka

Resolution: fixed
Status: newclosed

Fixed.

Note: See TracTickets for help on using tickets.