Ok, here's my customisations for anyone who's interested. These changes to the replaceDates function do the following
- Droped the seconds - the shouts are displayed in order anyway, my users don't care if a shout was 3 or 49 seconds ago
- Changed the date format to dd-mon , easier to read, all months are 3 letters helps keep it aligned at the month turnover.
Code:
// replaces <date> tags
function replaceDates(s) {
var ret = "";
var matches = s.match(/<date>\d+<\/date>/g);
var months=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug', 'Sep','Oct','Nov','Dec'];
for(var i = 0; matches != null && i < matches.length; i++) {
var utc = matches[i].match(/\d+/);
var date = new Date(utc * 1000);
ret = ret + s.substr(0, s.indexOf(matches[i]));
ret = ret + (
date.getDate() + "-" +
months[date.getMonth()]) + " " +
((date.getHours() < 10) ? " " : "") +
date.getHours() + ":" +
((date.getMinutes() < 10) ? "0" : "") +
date.getMinutes() + " ";
s = s.substr(s.indexOf(matches[i]) + matches[i].length);
}
ret = ret + s;
return ret;
}