We have moved to a new Sailfish OS Forum. Please start new discussions there.

Revision history [back]

click to hide/show revision 1
initial version

posted 2020-01-07 12:08:24 +0200

[Askbot] Dates in year 2020 formatted wrong

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!

[Askbot] Dates in year 2020 formatted wrong

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