User:Daniel Quinlan/Scripts/Clock.js

$(document).ready(function {	function currentTime($target) {		const now = new Date;		const hh = now.getUTCHours.toString.padStart(2, '0');		const mm = now.getUTCMinutes.toString.padStart(2, '0');		const delay = 60000 - (1000 * now.getUTCSeconds + now.getUTCMilliseconds);

$target.text(hh + ':' + mm); setTimeout(function {			currentTime($target);		}, delay); }

function addClock { const $clockElement = $(' ', { class: 'utc-clock vector-pinnable-element' });

$('.vector-settings#p-dock-bottom ul li:first-child').empty.append($clockElement); currentTime($clockElement); }

addClock; });