[Askbot] Dates in year 2020 formatted wrong

Tracked by Jolla (In progress)

asked 2020-01-07 12:08:24 +0300

Direc gravatar image

updated 2020-01-07 12:09:10 +0300

Hi,

Just noticed this: for example in this question the year part of the question update date is shown wrong, if the year is 2020. The date is shown as Jan 1 '0 instead of Jan 1 '20 and I think found the reason. In utils.js file at line 3578:

return month_date + ' ' + "'" + date.getYear() % 20;

This results year 2020 to be returned as "0" instead of "20". This is easily fixable; something along these lines should work (not tested, but you get the idea):

var y = date.getYear() % 100;
if (y < 10) {
  return month_date + " '0" + y;
}
else {
 return month_date + " '" + y;
}

The rotation loops every 100 years, but I think we can live with it ;-)

On the other hand, since TJC is using jQuery 1.7.2 and the newest timeago plugin requires 1.6.7 to work, the whole plugin could be updated, too. The offset parameter must then be set to appropriate value (positive integer in milliseconds).

Thanks!

edit: tags

edit retag flag offensive close delete

Comments

5

Hello, thanks we have noticed this and created an internal report.

jiit ( 2020-01-07 14:46:50 +0300 )edit
2

Maybe this shows how useful an update of askbot could be (2years later!)?

peterleinchen ( 2020-01-07 22:08:26 +0300 )edit
1

date.toLocaleDateString("en-US", {year: "2-digit"});

coderus ( 2020-01-07 23:11:13 +0300 )edit
1

@peterlinechen The 2020 roadmap blog says:

We’re also working to enhance communication between all Sailfish OS developers by introducing updates to our online discussion tools.

So maybe that means an Askbot update or replacement ? Alternatively could be related to the IRC meetings.

MartinK ( 2020-01-08 15:40:37 +0300 )edit

AskBot won't be replaced anytime soon I think, because it has been integrated with Jollas internal systems, too. But an upgrade would require less work, I think...

Direc ( 2020-01-19 11:55:50 +0300 )edit