improvements to date formatting

- leading zeros on month/day
- milliseconds in chat tooltips
This commit is contained in:
Jon Atkins
2013-05-26 19:29:48 +01:00
parent 84e0aeb679
commit 5430992d70
3 changed files with 23 additions and 4 deletions

View File

@ -394,7 +394,10 @@ window.chat.renderDivider = function(text) {
window.chat.renderMsg = function(msg, nick, time, team, msgToPlayer, systemNarrowcast) {
var ta = unixTimeToHHmm(time);
var tb = unixTimeToString(time, true);
var tb = unixTimeToDateTimeString(time, true);
//add <small> tags around the milliseconds
tb = (tb.slice(0,19)+'<small class="milliseconds">'+tb.slice(19)+'</small>').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;');
// help cursor via “#chat time”
var t = '<time title="'+tb+'" data-timestamp="'+time+'">'+ta+'</time>';
if ( msgToPlayer )