第5行:
第5行:
* in UTC+8, and also provides a link to purge the current page.
* in UTC+8, and also provides a link to purge the current page.
*
*
−
* Based on Gadget-UTCLiveClock.js (revision November 2017)
+
* Based on Gadget-UTCLiveClock.js (revision November 2017) with tweaks to get UTC+8 time
* Revision: June 2020
* Revision: June 2020
* Original Source: https://www.mediawiki.org/wiki/MediaWiki:Gadget-UTCLiveClock.js
* Original Source: https://www.mediawiki.org/wiki/MediaWiki:Gadget-UTCLiveClock.js
第28行:
第28行:
var mm = now.getUTCMinutes();
var mm = now.getUTCMinutes();
var ss = now.getUTCSeconds();
var ss = now.getUTCSeconds();
−
var time = padWithZeroes( hh ) + ':' + padWithZeroes( mm ) + ':' + padWithZeroes( ss );
+
var time = padWithZeroes( hh ) + ':' + padWithZeroes( mm ) + ':' + padWithZeroes( ss ) + ' UTC+8';
−
$target.text( `${time} UTC+8` );
+
$target.text( time );
// Schedule the next time change.
// Schedule the next time change.
第48行:
第48行:
// Set CSS styles. We do this here instead of on the CSS page because some
// Set CSS styles. We do this here instead of on the CSS page because some
// wikis load this page directly, without loading the accompanying CSS.
// wikis load this page directly, without loading the accompanying CSS.
−
mw.util.addCSS( '#utcdate a { font-weight:bolder; font-size:120%; }' );
+
mw.util.addCSS( '#utcdate { width: 6.8em; }' );
+
mw.util.addCSS( '#utcdate a { font-weight:bolder; }' );
// Reset whitespace that was set in the peer CSS gadget; this prevents the
// Reset whitespace that was set in the peer CSS gadget; this prevents the