Date format on posts

Date format on posts

in Forum and Website Bugs

Posted by: Healix.5819

Healix.5819

The date shown on posts has a minor issue with the "st" "nd" "rd" "th" part.

Here’s an example: "October 31undefined, 01:59" and "November 1nd, 23:08"

I took a look at the Javascript and noticed these are calculated using one big array with each one specified for the 31 days in a month. The problem is, getDate() returns 1-31 but the array is 0-30.

Simple fix, -1 from getDate(). Change:

case"day":return jQuery.timeago.settings.strings.preOrdinals[r.getDate()]+r.getDate()+jQuery.timeago.settings.strings.postOrdinals[r.getDate()];

To:

case"day":return jQuery.timeago.settings.strings.preOrdinals[r.getDate()-1]+r.getDate()+jQuery.timeago.settings.strings.postOrdinals[r.getDate()-1];

Date format on posts

in Forum and Website Bugs

Posted by: Drake Brimstone.3706

Drake Brimstone.3706

LOL, entry level programming error, arrays are base 0, not base 1.

Date format on posts

in Forum and Website Bugs

Posted by: synk.6907

synk.6907

Yeah, for example here you are listed as having posted on "November 3th". I was just in a thread that listed the date as "November 2rd" for posts. I was looking to see if anyone else had posted about this.

Nice find in the javascript. I hadn’t gone that far. I wonder if the issue with the preOrdinals setting is the fault of whomever wrote Timeago for jQuery, though, and not actually this forum’s admin.
edit: Nope, Timeago doesn’t seem to have this variable.

Well wherever the error came from, I gotta agree with the above poster -- always make sure your index values and the values you use agree. ;)

(edited by synk.6907)

Date format on posts

in Forum and Website Bugs

Posted by: synk.6907

synk.6907

So

Dates still show up with the wrong suffix after the numbers for the first, second, and third of a month as described. That’s a pretty easy fix provided in the OP... any chance it would get implemented?