// create a new UI element in the status bar var newNode = document.createElement('div'); newNode.setAttribute("id", "status-date"); var referenceNode = document.querySelector('#status-ping'); referenceNode.after(newNode); send_GMCP("IRE.Time.Request", "");2) add to your onGMCP, or integrate into any existing IRE.Time.List and IRE.Time.Update logic you have there:
if (args.gmcp_method == "IRE.Time.List" || args.gmcp_method == "IRE.Time.Update") { $('#status-date').text(args.gmcp_args.year + '-' + String(args.gmcp_args.mon).padStart(2,'0') + '-' + String(args.gmcp_args.day).padStart(2,'0') + ' ' + ['mwinter','lwinter','espring','mspring','lspring','esummer','msummer','lsummer','eautumn','mautumn','lautumn','e-winter'][args.gmcp_args.mon-1]); };Result:
Comments
onLoad
onGMCP
You can see from this how to add a third one for moon phase (or something else), which I would do, except I never bothered to make anything that tracks/calculates the current moon phase since none of my skills depend on it.
var dateNode = document.createElement('div');
dateNode.setAttribute("id", "status-date");
var referenceNode = document.querySelector('#status-target');
referenceNode.after(dateNode);
var seasonNode = document.createElement('div');
seasonNode.setAttribute("id", "status-season");
dateNode.after(seasonNode);
}