MediaWiki:Common.js

From Gawler History
Revision as of 22:10, 2 July 2019 by Tim (talk | contribs)
Jump to: navigation, search

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
/* Any JavaScript here will be loaded for all users on every page load. */

// Current Server Time script (SSI or PHP)- By JavaScriptKit.com (http://www.javascriptkit.com)
// For this and over 400+ free scripts, visit JavaScript Kit- http://www.javascriptkit.com/
// This notice must stay intact for use.

var currenttime = 'February 06, 2019 11:22:19' //PHP method of getting server date

var options = {
    timeZone: "Australia/Adelaide",
    hour12: false,
    hour: 'numeric', minute: 'numeric', second: 'numeric'
};

var formatter = new Intl.DateTimeFormat([], options);

var UTCTime = "2017-09-03T02:00:00Z";
var localTime = formatter.format(new Date());
var currentTime = formatter.format(new Date());

var gawlertime = new Date().toLocaleString("en-AU", {timeZone: "Australia/Adelaide"});
gawlertime = new Date(gawlertime);

var serverdate=currentTime;

function padlength(what){
var output=(what.toString().length==1)? "0"+what : what
return output
}

function displaytime(){
currentTime = formatter.format(new Date())
document.getElementById("gawlertime").innerHTML=currentTime
}

window.onload=function(){
setInterval("displaytime()", 1000)
}

mw.loader.load( '/mediawiki/index.php?title=MediaWiki:GTAG.js&action=raw&ctype=text/javascript' );
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());