User:Mrdempsey/LocalClock.js

/* This is a local time zone clock for the upper right, it is a modified version of the UTC clock gadget. function liveLClock {	liveLClock.node = mw.util.addPortletLink( 'p-personal', mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '/index.php?title=' + encodeURIComponent(mw.config.get('wgPageName')) + '&action=purge', '', 'localdate' ); liveLClock.node.style.fontSize = 'larger'; liveLClock.node.style.fontWeight = 'bolder'; showLTime; } addOnloadHook(liveLClock) function showLTime {	var dateNode = liveLClock.node; if( !dateNode ) { return; }   var now = new Date; var hh = now.getHours; var mm = now.getMinutes; var ss = now.getSeconds; var time = ( hh < 10 ? '0' + hh : hh ) + ':' + ( mm < 10 ? '0' + mm : mm ) + ':' + ( ss < 10 ? '0' + ss : ss ); dateNode.firstChild.replaceChild( document.createTextNode( time ), dateNode.firstChild.firstChild ); window.setTimeout(showLTime, 1000); }