If you are a player of BlogNomic and wish to edit this Wiki, you must first log in.

CalendarDisplay

HomePage | RecentChanges | Preferences

To add the Calendar to the Sidebar

Find this line in the clockInit function:
	clock.appendChild(document.createTextNode('00:00:00'));
Insert this code after that line:
	var day = infoWrap.appendChild(document.createElement(div));
	var dt = new Date();
	var def = dt.getTimezoneOffset()/60;
	var gmt = (dt.getHours() + def);
	
	day.appendChild(document.createTextNode('Aeon: '));
	
	var year = (dt.getDate() - X + (gmt > 24)) * 10;
	year += Math.floor(((gmt % 24) * 60 + dt.getMinutes())/144);
	
	day.appendChild(document.createTextNode(year + ' AA'));

To Reset the Year

To change the year in the template is a simple matter. First, find the line that reads:

var year = (dt.getDate() - X + (gmt > 24)) * 10;

Change X to the date that the Dynasty started, which is basically when the ascension address was posted. For example, if the Dynasty started on December 14th, change X to 14. Note that this code does not roll over a month properly, so once the month changes the X must be updated to show its relative date to the next month. If the example Dynasty has now entered January, then the X would become -17 (December 31 - December 14).

Now go a few lines down to:

day.appendChild(document.createTextNode(year + ' AA'));

Change " AA" to whatever the new Emperor (or Empress, or Shiny Object Lover, or... you get it) has decreed the date to be named. So if it's going to be counted in Year of Kevan, change it to Y.K. Make sure there's a space after the first apostrophe, otherwise the date will look like "15Y.K." You want "15 Y.K."

Everything else is automated, so all that's left is to save the changes, republish the index, remind Kevan to update the date system in the GNDT as well, and enjoy your newly formatted calendar!


HomePage | RecentChanges | Preferences
This page is read-only | View other revisions | Text Formatting Rules
Last edited February 11, 2005 7:00 pm by Smith (diff)
Search: