Sundays of Pleroma: Difference between revisions
Jump to navigation
Jump to search
Line 53: | Line 53: | ||
== Next ten years == | == Next ten years == | ||
<html> | |||
<div id="SundayTable"></div> | |||
<div id="DebugDiv"></div> | |||
<script type="text/javascript"> | |||
//---------------------------------------------------------- | |||
// | |||
// Global variables | |||
// | |||
// | |||
// 11 elements in each row. | |||
// | |||
// First pattern to add to table: PleromaPattern[7] -- Eucharist Prayers | |||
// Second pattern to add: PleromaPattern[8] -- headings | |||
const FixedPattern = [ | |||
["9 Oct","16 Oct","23 Oct","30 Oct", "6 Nov","13 Nov","20 Nov","Sunday" ], | |||
["15 Oct","22 Oct","29 Oct", "5 Nov","12 Nov","19 Nov","26 Nov","Monday" ], | |||
["14 Oct","21 Oct","28 Oct", "4 Nov","11 Nov","18 Nov","25 Nov","Tuesday" ], | |||
["13 Oct","20 Oct","27 Oct", "3 Nov","10 Nov","17 Nov","24 Nov","Wednesday"], | |||
["12 Oct","19 Oct","26 Oct", "2 Nov", "9 Nov","16 Nov","23 Nov","Thursday" ], | |||
["11 Oct","18 Oct","25 Oct", "1 Nov", "8 Nov","15 Nov","22 Nov","Friday" ], | |||
["10 Oct","17 Oct","24 Oct","31 Oct", "7 Nov","14 Nov","21 Nov","Saturday" ] | |||
] | |||
const Headings = [ | |||
[" "," ","III" , "IV" , "I" , "II", "III", "IV", "I" ,"Xmas"], | |||
["year","cycle","Week 28","Week 29","Week 39","Week 31","Week 32","Week 33","Christ the King", "DoW"] | |||
]; | |||
const DerivedArray = []; | |||
var TodayDate = new Date(); | |||
var ThisYear = TodayDate.getFullYear(); | |||
var DbgDv = document.getElementById("DebugDiv"); | |||
var SundayTable = document.getElementById("SundayTable"); | |||
// create elements <table> and a <tbody> | |||
var tbl = document.createElement("table"); | |||
var tblBody = document.createElement("tbody"); | |||
//------------------------------------------------ | |||
function DebugLine(msg){ | |||
var tmpstr = DbgDv.innerHTML + "<br>" + msg; | |||
DbgDv.innerHTML = tmpstr; | |||
} | |||
//------------------------------------------- | |||
function CompletePatternFor(aYear){ | |||
var Scaffold = []; | |||
var XmasStr = "December 25, "+aYear; | |||
const XmasInYear = new Date(XmasStr); | |||
var DoWx = XmasInYear.getDay(); | |||
// copy pattern from fixed array to derived array | |||
Scaffold.push(aYear.toString()); | |||
const cycle = ["A","B","C"]; | |||
// year A = 2023 | |||
firstremainder = aYear % 2023; | |||
ABCindex = firstremainder % 3; | |||
Scaffold.push(cycle[ABCindex]); | |||
for (var j = 0; j<=7; j++) { | |||
Scaffold.push(FixedPattern[DoWx][j]); | |||
} | |||
console.log(Scaffold); | |||
DerivedArray.push(Scaffold); | |||
console.log(DerivedArray); | |||
} | |||
< | //------------------------------------------- | ||
function MakeHeadings() { | |||
for (var j = 0; j <= 1; j++) { | |||
var row = document.createElement("tr"); | |||
for (var k = 0; k <= 9; k++) { | |||
var cell = document.createElement("td"); | |||
var cellText = document.createTextNode("\u00A0" + Headings[j][k] + "\u00A0"); | |||
cell.appendChild(cellText); | |||
row.appendChild(cell); | |||
row.setAttribute("align","center"); | |||
row.setAttribute("style","font-weight:bold"); | |||
} | |||
tblBody.appendChild(row); | |||
} | |||
} | |||
function | //------------------------------------------- | ||
function AddDataRows(){ | |||
for (var j = 0; j <= 9; j++) { | |||
var row = document.createElement("tr"); | |||
for (var k = 0; k <= 9; k++) { | |||
var cell = document.createElement("td"); | |||
var cellText = document.createTextNode(DerivedArray[j][k]); | |||
cell.appendChild(cellText); | |||
row.appendChild(cell); | |||
} | |||
row.setAttribute("align","center"); | |||
tblBody.appendChild(row); | |||
} | |||
// console.log(row); | |||
} | |||
//------------------------------------------- | |||
function CreateSundayTable() { | |||
MakeHeadings(); | |||
AddDataRows(); | |||
// append the <tbody> inside the <table> | |||
tbl.appendChild(tblBody); | |||
// put <table> in the <body> | |||
SundayTable.appendChild(tbl); | |||
tbl.setAttribute("border", "1"); | |||
tbl.setAttribute("style", "padding:5px; border-collapse:collapse; border-spacing:0px; border-width:1px") | |||
} | |||
//------------------------- Main script ----------------------------------- | |||
// | |||
// Calculate three vital pieces of information: year, cycle, Xmas DoW | |||
// | |||
// | |||
for (var x = 0; x <= 9; x++){ | |||
var | var SetYear = ThisYear + x; | ||
CompletePatternFor(SetYear); | |||
} | } | ||
CreateSundayTable(); | |||
// | |||
// | |||
</script> | </script> | ||
</html> | </html> | ||
[[Category:Pleroma]] | [[Category:Pleroma]] |
Revision as of 00:09, 12 November 2024
Seven patterns
P1 | Xt King | Advent I | Christmas Day |
---|---|---|---|
9 Oct | 20 Nov | 27 Nov | Sunday |
15 Oct | 26 Nov | 3 Dec | Monday |
14 Oct | 25 Nov | 2 Dec | Tuesday |
13 Oct | 24 Nov | 1 Dec | Wednesday |
12 Oct | 23 Nov | 30 Nov | Thursday |
11 Oct | 22 Nov | 29 Nov | Friday |
10 Oct | 21 Nov | 28 Nov | Saturday |
Next ten years