User:Proteins/computus.js

// // Calculates the date of Easter by various methods // Derived from the algorithms described in: // Richards EG (1998) Mapping Time and Its History, Oxford University Press, Oxford, ISBN 0-19-286205-7, pp. 345-378. // // To use this script, add "importScript('User:Proteins/computus.js');" to your monobook.js subpage // under your user page, as you can see at User:Proteins/monobook.js

// Published in E. G. Richards (1998). function computus_Georgian_Richards(Georgian_year) { var a = 0; var b = 0; var c = 0; var d = 0; var e = 0; var u = 0; var v = 0; var w = 0; var s = 0; a = (Georgian_year/4); b = a - (a/4); c = (Georgian_year%19); u = (a - 17)/25; v = (a - u)/3; w = 15 + (19*c) + b - v;	d = (w%30); e = d - ((c + (11*d))/19); x = 140004 - Georgian_year - (Georgian_year/4) + b - e;	s = 22 + e - (x%7);

return s; } // closes function computus_Georgian_Richards

function computus { var alert_string = "";

alert_string = "Hello world!"; window.alert(alert_string); }

$(function { mw.util.addPortletLink('p-navigation', 'javascript:computus', 'Easter Sunday', 'ca-easter', 'Date of Easter Sunday', , ); }); //