Closed Bug 1608960 Opened 6 years ago Closed 6 years ago

2018 is not last year

Categories

(bugzilla.mozilla.org :: User Interface, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: grahamperrin, Assigned: kohei)

References

(Regression)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:56.0) Gecko/20100101 Firefox/56.0 Waterfox/56.3

Steps to reproduce:

  1. At (for example) https://bugzilla.mozilla.org/show_bug.cgi?id=1497581#summary-container – a bug that was opened in 2018

Actual results:

  1. observe the phrase "Opened last year"
  2. point at the phrase "last year"
  3. observe a date from the year before last

Expected results:

  1. observe the phrase "Opened two years ago"

Component: Bugzilla-General → User Interface

Interesting...
1481509 created on 2018-08-07 shows "Last year" for me.
1481409 created on 2018-08-07 shows "2 years ago" for me.

Product: Bugzilla → bugzilla.mozilla.org
QA Contact: default-qa

Thanks.

In bug number order, viewed here in the UK with home-built Waterfox Classic 2019.12 (20200103060435) on FreeBSD-CURRENT:

  • bug 1481409 opened 2018-08-07 02:54 PDT (2 years ago) closed 2018-08-14 09:22 PDT (last year)
  • bug 1481509 opened 2018-08-07 09:18 PDT (2 years ago) closed 2018-08-14 17:57 PDT (last year)
  • bug 1515945 opened 2018-12-21 07:22 PST (last year)

Well, in Bug 1543881, I changed the date labels to use “last year” instead of “a year ago” but I didn’t look at the logic carefully. The commit can be easily reverted, but I think the logic itself could be simplified, maybe. And I prefer “1 year ago” than “a year ago” anyway.

if (ss < 10) return 'Just now';
if (mm < 1) return ss + ' seconds ago';
if (mm < 2) return '1 minute ago';
if (hh < 1) return mm + ' minutes ago';
if (hh < 2) return '1 hour ago';
if (dd < 1) return hh + ' hours ago';
if (dd < 2) return '1 day ago';
if (mo < 1) return dd + ' days ago';
if (mo < 2) return '1 month ago';
if (yy < 1) return mo + ' months ago';
if (yy < 2) return '1 year ago';
return yy + ' years ago';
Assignee: general → kohei.yoshino
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Regressed by: 1543881
Attached file GitHub Pull Request

Thank you,

(In reply to Kohei Yoshino [:kohei] from comment #3)

… I prefer “1 year ago” than “a year ago” …

Me too.

Merged to master.

Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Regressions: 1614634
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: