User:Ozuzanna/chattimestamps.js

/* if (mw.config.get('wgCanonicalSpecialPageName') !== "Chat") return;
 * Chat Timestamps
 * @description Create/refine timestamps for each message or alert in chat to be in the format of HH:MM:SS
 * @author Ozuzanna
 * (function($, mw) {

var object, timestamp, time, minutes, seconds; mainRoom.model.chats.bind("afteradd", function (child) {	object = $('#entry-' + child.cid);	time = new Date;	minutes = time.getMinutes;	seconds = time.getSeconds;	if (minutes < 10)		minutes = "0" + minutes;	if (seconds < 10)		seconds = "0" + seconds;	timestamp = time.getHours + ":" + minutes + ":" + seconds;

if (object.children('.time').length) object.children('.time').text(timestamp); else object.append(' ' + timestamp + ' '); }); }) (this.jQuery, this.mediaWiki);