diff --git a/src/static/js/chat.js b/src/static/js/chat.js index 79224e80c..ab815b870 100644 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -82,13 +82,22 @@ var chat = (function() msg.time += this._pad.clientTimeOffset; //create the time string - var minutes = "" + new Date(msg.time).getMinutes(); - var hours = "" + new Date(msg.time).getHours(); + var msgDate = new Date(msg.time); + var minutes = "" + msgDate.getMinutes(); + var hours = "" + msgDate.getHours(); + var month = "" + (msgDate.getMonth() + 1); + var day = "" + msgDate.getDate(); + var year = "" + (msgDate.getYear() + 1900); if(minutes.length == 1) minutes = "0" + minutes ; if(hours.length == 1) hours = "0" + hours ; + if(month.length == 1) + month = "0" + month ; + if(day.length == 1) + day = "0" + day ; var timeStr = hours + ":" + minutes; + var dateStr = month + "/" + day + "/" + year; //create the authorclass var authorClass = "author-" + msg.userId.replace(/[^a-y0-9]/g, function(c) @@ -111,7 +120,7 @@ var chat = (function() var authorName = msg.userName == null ? _('pad.userlist.unnamed') : padutils.escapeHtml(msg.userName); - var html = "
"; + var html = " "; $("#chattext").append(html); //should we increment the counter??