if (typeof localGroupName === 'undefined') { var localGroupName = ""; } if (typeof localGroupShortName === 'undefined') { var localGroupShortName = localGroupName; } if (typeof showForeign === 'undefined') { var showForeign = "Yes"; } if (typeof showPrivate === 'undefined') { var showPrivate = "Yes"; } if (typeof showAOGuide === 'undefined') { var showAOGuide = "No"; } if (typeof showOtherLocal === 'undefined') { var showOtherLocal = "Yes"; } var json = JSON.parse(' {"diary": [{"title":"Twelfth Night","publicPrivate":"private","startDate":"2026-01-03","endDate":"2026-01-03","dateline":"","datelineEra":"unknown","datelineAOGuide":"N/A","type":"Feast","nationalShow":"true","localTraining":"false","nonRegiaEvent":false,"cancelled":false,"address1":"Wychurst","address2":"Kent","postcode":"","country":"United Kingdom","website":"","FacebookLink":"","details":""},{"title":"Islip Training Weekend","publicPrivate":"private","startDate":"2026-01-17","endDate":"2026-01-18","dateline":"","datelineEra":"unknown","datelineAOGuide":"N/A","type":"Training","nationalShow":"true","localTraining":"false","nonRegiaEvent":false,"cancelled":false,"address1":"Islip","address2":"Oxfordshire","postcode":"OX5 2TA","country":"United Kingdom","website":"","FacebookLink":"","details":""},{"title":"Jorvik Viking Festival","publicPrivate":"public","startDate":"2026-02-21","endDate":"2026-02-21","dateline":"","datelineEra":"unknown","datelineAOGuide":"N/A","type":"Major Event","nationalShow":"true","localTraining":"false","nonRegiaEvent":false,"cancelled":false,"address1":"York","address2":"Yorkshire","postcode":"YO1 9RY","country":"United Kingdom","website":"https://jorvikvikingfestival.co.uk/events/battle-for-york/","FacebookLink":"","details":""},{"title":"Wallingford Museum Saxon Day","publicPrivate":"public","startDate":"2026-04-11","endDate":"2026-04-11","dateline":"900","datelineEra":"early","datelineAOGuide":"https://regia.org/members/docs/2015AO-900-979.pdf","type":"Hwitmearum Local Show","nationalShow":"false","localTraining":"false","nonRegiaEvent":false,"cancelled":false,"address1":"Wallingford","address2":"Royal County of Berkshire","postcode":"OX10 0DB","country":"United Kingdom","website":"","FacebookLink":"","details":"A repeat Anglo-Saxon and Viking open day at Wallingford Museum."},{"title":"Wychurst at War","publicPrivate":"private","startDate":"2026-04-25","endDate":"2026-04-26","dateline":"","datelineEra":"unknown","datelineAOGuide":"N/A","type":"Training","nationalShow":"true","localTraining":"false","nonRegiaEvent":false,"cancelled":false,"address1":"Wychurst","address2":"Kent","postcode":"","country":"United Kingdom","website":"","FacebookLink":"","details":""},{"title":"The Banshees Charity Fundraiser","publicPrivate":"public","startDate":"2026-04-25","endDate":"2026-04-25","dateline":"1000","datelineEra":"mid","datelineAOGuide":"https://regia.org/members/docs/2015AO-980-1041.pdf","type":"Wessex Local Show","nationalShow":"false","localTraining":"false","nonRegiaEvent":false,"cancelled":false,"address1":"Barton Hill Rugby Club, Speedwell","address2":"Bristol, Gloucestershire","postcode":"BS15 1NR","country":"United Kingdom","website":"","FacebookLink":"","details":"Just a fun knock about training in public, to assist a fun raising day."},{"title":"WarAg Living History Festival","publicPrivate":"public","startDate":"2026-05-23","endDate":"2026-05-24","dateline":"","datelineEra":"unknown","datelineAOGuide":"N/A","type":"Wessex Local Show","nationalShow":"false","localTraining":"false","nonRegiaEvent":false,"cancelled":false,"address1":"Middlezoy Aerodrome, Weston Zoyland, Bridgewater","address2":"Somerset","postcode":"TA7 0JS","country":"United Kingdom","website":"https://www.warag.co.uk/","FacebookLink":"","details":""},{"title":"Leominster Priory","publicPrivate":"public","startDate":"2026-05-30","endDate":"2026-05-31","dateline":"","datelineEra":"unknown","datelineAOGuide":"N/A","type":"Major Event","nationalShow":"true","localTraining":"false","nonRegiaEvent":false,"cancelled":false,"address1":"Leominster Priory","address2":"Herefordshire","postcode":"HR6 8NH","country":"United Kingdom","website":"","FacebookLink":"","details":"Small ship burial for a fallen Viking inside the priory chancel; LHE with key aspects related to the workings of a minster; modest sized battlefield; fashion show; Regia ecclesiastical community involvement with Latin prayer and added frankincense in conjunction with the vicar there. "},{"title":"History in the Park","publicPrivate":"public","startDate":"2026-06-05","endDate":"2026-06-07","dateline":"","datelineEra":"unknown","datelineAOGuide":"N/A","type":"Major Event","nationalShow":"true","localTraining":"false","nonRegiaEvent":false,"cancelled":false,"address1":"Craigtoun Country Park, Mount Melville","address2":"St Andrews, Fife","postcode":"KY16 8NX","country":"United Kingdom","website":"","FacebookLink":"","details":""},{"title":"Burford Festival: Battle of Burford","publicPrivate":"public","startDate":"2026-06-20","endDate":"2026-06-20","dateline":"752","datelineEra":"unknown","datelineAOGuide":"N/A","type":"Hwitmearum Local Show","nationalShow":"false","localTraining":"false","nonRegiaEvent":false,"cancelled":false,"address1":"Burford","address2":"Oxfordshire","postcode":"OX18 ","country":"United Kingdom","website":"","FacebookLink":"","details":"A small show to celebrate the battle of Burford between Wessex and Mercia, LHE parade and combat display."},{"title":"High Witan","publicPrivate":"private","startDate":"2026-11-21","endDate":"2026-11-21","dateline":"","datelineEra":"unknown","datelineAOGuide":"N/A","type":"AGM","nationalShow":"true","localTraining":"false","nonRegiaEvent":false,"cancelled":false,"address1":"Knowle, Solihull","address2":"Warwickshire","postcode":"B93 0NH","country":"United Kingdom","website":"","FacebookLink":"","details":""}]}'); var entry = json.diary; //style to use as background var background = "background:rgba(0,0,0,0.1);"; var dateOptions = { weekday: "long", year: "numeric", month: "short", day: "numeric" }; var borders = "border:1px black;border-style:solid none;" var calendar = ""; borders = "border:1px black;border-style:none none solid;" //overrides it for remaining table //declare attributes we are going to use var entryTitle; var entryDates; var entryAddress; var entryType; var showEntry; for (i=0;i" + entry[i].title + ""; if (entry[i].dateline != "") entryTitle += "
Dateline: " + entry[i].dateline + ""; if (entry[i].details != "" && entry[i].localTraining != "true") entryTitle += "
"+entry[i].details; if (entry[i].website != "") entryTitle += "
Website"; if (showAOGuide == "Yes" && entry[i].datelineAOGuide!="N/A") entryTitle += "
AO Guide"; entryTitle += ""; if (entry[i].startDate == entry[i].endDate) { entryDates = "
"; } else { entryDates = ""; } if (entry[i].address1 != "" && entry[i].address2 != "") entryAddress += entry[i].address1 +", "+entry[i].address2; if (entry[i].address1 != "" && entry[i].address2 == "") entryAddress += entry[i].address1; if (entry[i].address1 == "" && entry[i].address2 != "") entryAddress += entry[i].address2; if (entryAddress !="" && entry[i].postcode != "") entryAddress += "
"+entry[i].postcode; if (entryAddress =="" && entry[i].postcode != "") entryAddress += entry[i].postcode; if (entry[i].country != "United Kingdom") entryAddress += "
"+entry[i].country; if (entry[i].type == localGroupShortName + " Local Show" || (entry[i].type == "Major Event" && showOtherLocal != "No") ) { //makes locals of this group and major events red (only for major events if we are showing other local shows) entryType = "" + entry[i].type + ""; } else if (entry[i].title == localGroupName+" Local Training") { //makes local training for this group red entryType = "" + localGroupShortName + " Training"; } else { entryType = entry[i].type; } if (entryAddress !="") entryType += " at
"; entryComplete = "" + entryTitle + entryDates + ""; calendar += entryComplete; } } var output = document.getElementById("diaryTable"); console.log(output); output.innerHTML = calendar; console.log(output);
EventDateDetails
" + new Date(entry[i].startDate).toLocaleDateString("en-GB", dateOptions) + "" + new Date(entry[i].startDate).toLocaleDateString("en-GB", dateOptions) + " to
" + new Date(entry[i].endDate).toLocaleDateString("en-GB", dateOptions) + "
" + entryType + entryAddress + "