Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
letterly authored Mar 6, 2024
1 parent 68e584f commit 758dc1a
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 19 deletions.
4 changes: 4 additions & 0 deletions calendar-changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
</head>

<pre><h1>Updates</h1>
<h3>3 March 2024</h3>
>Monthly celebrations is now called Monthly practices
>Added Rhumb line prayer direction calculators

<h3>2 March 2024</h3>
>Finally fixed issues with the prayer direction determiner
>Added a few new cities
Expand Down
2 changes: 2 additions & 0 deletions calendar-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -1870,6 +1870,7 @@ calendars = {
era: "AA",
link: "https://en.wikipedia.org/wiki/Mandaean_calendar",
},
/*
"Mandaean Reformed": {
firstDay: "Sunday",
dayStart: "Sunrise",
Expand Down Expand Up @@ -1961,6 +1962,7 @@ calendars = {
era: "AA",
link: "https://en.wikipedia.org/wiki/Mandaean_calendar",
},
*/
Minguo: {
firstDay: "Sunday",
dayStart: "Midnight",
Expand Down
2 changes: 1 addition & 1 deletion calendar.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h1>Universal Calendar Project</h1>
<option value="French Republican">French Republican</option>
<option value="Indian National">Indian National</option>
<option value="Kurdish">Kurdish</option>
<option value="Mandaean Reformed">Mandaean Reformed</option> <!-- Temporary -->
<!-- <option value="Mandaean Reformed">Mandaean Reformed</option> -->
<option value="Nanakshahi">Mool Nanakshahi</option>
<option value="Nepal Sambat Solar">Nepal Sambat Solar</option>
<option value="Solar Hijri">Solar Hijri</option>
Expand Down
53 changes: 38 additions & 15 deletions calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,10 @@ function locationChange(){
lat: 21.4225,
long: 39.826167,
},
Kaaba2: {
lat: 21.4225,
long: 39.826167,
},
Gerizim: {
lat: 32.200861,
long: 35.273258,
Expand All @@ -390,6 +394,10 @@ function locationChange(){
lat: 31.778056,
long: 35.235833,
},
Temple2: {
lat: 31.778056,
long: 35.235833,
},
Qiblih: {
lat: 32.943611,
long: 35.091944,
Expand All @@ -401,17 +409,32 @@ function locationChange(){
}

for(h of Object.keys(holysites)){
g = directionalize(holysites[h].lat, holysites[h].long)
if(holysites[h].long < locinfo[1]){
if(g < 0){
g = 360 + g
if(!h.endsWith("2")){
g = directionalize(holysites[h].lat, holysites[h].long)
if(holysites[h].long < locinfo[1]){
if(g < 0){
g = 360 + g
}
else{
g += 180
}
}
else{
g += 180
if(g < 0) g = 180 + g
}
}
else{
if(g < 0) g = 180 + g
latA = locinfo[0] * Math.PI / 180
latB = holysites[h.slice(0,-1)].lat * Math.PI / 180
lonA = locinfo[1] * Math.PI / 180
lonB = holysites[h.slice(0,-1)].long * Math.PI / 180
Δφ = Math.log( Math.tan( latB / 2 + Math.PI / 4 ) / Math.tan( latA / 2 + Math.PI / 4) )
Δlon = Math.abs( lonA - lonB )
g = Math.atan2( Δlon , Δφ )
g = g * 180 / Math.PI
if(holysites[h].long < locinfo[1]){
g = 360 - g
}
}
g = Math.round(g * 10) / 10
dir = ""
Expand All @@ -427,14 +450,14 @@ function locationChange(){
}

angles.innerHTML = "<a style='font-weight:700;color:black' href='https://en.wikipedia.org/wiki/Direction_of_prayer' target='_blank'>Directions of prayer</a>: "
if(city != "Jerusalem") angles.innerHTML += "<a class='hebrew' href='https://en.wikipedia.org/wiki/Mizrah' target='_blank'>Judaism (Mizrah)</a>: " + holysites.Temple.direction
else angles.innerHTML += `<a class='hebrew' href='https://en.wikipedia.org/wiki/Mizrah' target='_blank'>Judaism (Mizrah)</a>: Face the <a href="https://en.wikipedia.org/wiki/Temple_Mount">Temple Mount</a>`
if(city != "Nablus") angles.innerHTML += " | <a class='samaritan' href='https://en.wikipedia.org/wiki/Mount_Gerizim' target='_blank'>Samaritanism</a>: " + holysites.Gerizim.direction
else angles.innerHTML += `<a class='samaritan' href='https://en.wikipedia.org/wiki/Mount_Gerizim' target='_blank'>Samaritanism</a>: Face <a href="https://en.wikipedia.org/wiki/Mount_Gerizim">Mount Gerizim</a>`
if(city != "Mecca") angles.innerHTML += ` | <a class="islamic_tabular" href="https://en.wikipedia.org/wiki/Qibla" target="_blank">Islam (Qibla)</a>: ` + holysites.Kaaba.direction
else angles.innerHTML += ` | <a class="islamic_tabular" href="https://en.wikipedia.org/wiki/Qibla" target="_blank">Islam (Qibla)</a>: Face the <a target="_blank" href="https://en.wikipedia.org/wiki/Kaaba">Kaaba</a>`
if(city != "Akko") angles.innerHTML += " | <a class='baháí' href='https://en.wikipedia.org/wiki/Qiblih' target='_blank'>Bahá'í (Qiblih)</a>: " + holysites.Qiblih.direction
else angles.innerHTML += ` | <a class="baháí" href="https://en.wikipedia.org/wiki/Qiblih" target="_blank">Bahá'í (Qiblih)</a>: Face the <a target="_blank" href="https://en.wikipedia.org/wiki/Shrine_of_Bah%C3%A1%CA%BCu%27ll%C3%A1h">Shrine of Baháʼu'lláh</a>`
if(city != "Jerusalem") angles.innerHTML += "<a class='hebrew' href='https://en.wikipedia.org/wiki/Mizrah' target='_blank'>Judaism (Mizrah)</a>: " + holysites.Temple.direction + ` <small><a href="https://en.wikipedia.org/wiki/Great_circle" target="_blank">Great Circle</a></small> // ` + holysites.Temple2.direction + ` <small><a href="https://en.wikipedia.org/wiki/Rhumb_line" target="_blank">Rhumb Line</a></small>`
else angles.innerHTML += `<a class='hebrew' href='https://en.wikipedia.org/wiki/Mizrah' target='_blank'>Judaism (Mizrah)</a>: Face the <a target="_blank" href="https://en.wikipedia.org/wiki/Temple_Mount">Temple Mount</a>`
if(city != "Nablus") angles.innerHTML += " <b>|</b> <a class='samaritan' href='https://en.wikipedia.org/wiki/Mount_Gerizim' target='_blank'>Samaritanism</a>: " + holysites.Gerizim.direction
else angles.innerHTML += ` <b>|</b> <a class='samaritan' href='https://en.wikipedia.org/wiki/Mount_Gerizim' target='_blank'>Samaritanism</a>: Face <a target="_blank" href="https://en.wikipedia.org/wiki/Mount_Gerizim">Mount Gerizim</a>`
if(city != "Mecca") angles.innerHTML += ` <b>|</b> <a class="islamic_tabular" href="https://en.wikipedia.org/wiki/Qibla" target="_blank">Islam (Qibla)</a>: ` + holysites.Kaaba.direction + ` <small><a href="https://en.wikipedia.org/wiki/Great_circle" target="_blank">Great Circle</a></small> // ` + holysites.Kaaba2.direction + ` <small><a href="https://en.wikipedia.org/wiki/Rhumb_line" target="_blank">Rhumb Line</a></small>`
else angles.innerHTML += ` <b>|</b> <a class="islamic_tabular" href="https://en.wikipedia.org/wiki/Qibla" target="_blank">Islam (Qibla)</a>: Face the <a target="_blank" href="https://en.wikipedia.org/wiki/Kaaba">Kaaba</a>`
if(city != "Akko") angles.innerHTML += " <b>|</b> <a class='baháí' href='https://en.wikipedia.org/wiki/Qiblih' target='_blank'>Bahá'í (Qiblih)</a>: " + holysites.Qiblih.direction
else angles.innerHTML += ` <b>|</b> <a class="baháí" href="https://en.wikipedia.org/wiki/Qiblih" target="_blank">Bahá'í (Qiblih)</a>: Face the <a target="_blank" href="https://en.wikipedia.org/wiki/Shrine_of_Bah%C3%A1%CA%BCu%27ll%C3%A1h">Shrine of Baháʼu'lláh</a>`
}


Expand Down Expand Up @@ -3639,7 +3662,7 @@ function holidaycheck(thatday){
if(thatday["Bahá'í"].startsWith("1 ")){
monthly.innerHTML += `<h2 class="baháí"><a style="color:inherit;text-decoration:dotted underline" href="https://en.wikipedia.org/wiki/Bah%C3%A1%CA%BC%C3%AD_Faith" target="_blank">Bahá'í Faith</a>: <a target="_blank" style="color:inherit;font-weight:700;text-decoration:underline" href="https://en.wikipedia.org/wiki/Nineteen_Day_Feast">Nineteen Day Feast</a></h2>`
}
if(monthly.innerHTML != "") monthly.innerHTML = "<h3>Monthly celebrations</h3>" + monthly.innerHTML
if(monthly.innerHTML != "") monthly.innerHTML = "<h3>Monthly traditions</h3>" + monthly.innerHTML

//
weekly.innerHTML = ""
Expand Down
7 changes: 4 additions & 3 deletions calendarharris.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ startDays = {
"Hebrew": [1, "Shvat", 5660],
"Islamic Tabular": [28, "Sha'ban", 1317],
"Bengali": [18, "Poush", 1306],
"Mandaean": [19, "Ṣilmia", 445269],
}

hebrewCons = (/*660*/"rcdcrccrdc|drccrdcrcd|rccdrccdrc|drccrdcrcd|crcdrcdrcc|drccdrccrd|crdcrcdcrc|drcdcrcdrc|cdrccrdcrd|crcdcrcdrc|cdrccdrcdr|ccrdcrcdrc|cdrcdcrccr|dcrdccrdcr|cdrcdcrcdr|ccdrccrdcr|dc"/*to 821*/).replace(/\|/g,"")
Expand Down Expand Up @@ -39,7 +40,7 @@ function toHarrisDate(date, cal){
firstDays = dayWithinYear(startDays[cal].join(" "), cal).split("/")[1] - dayWithinYear(startDays[cal].join(" "), cal).split("/")[0] + 1
intermediateYears = 0
for(x = startDays[cal][2] + 1; x < leYear; x++){
//intermediateYears += daysWithinYear(getYear(x, cal))
intermediateYears += daysWithinYear(getYear(x, cal))
}
finalDays = dayWithinYear(date, cal).split("/")[0]
total = firstDays + +intermediateYears + +finalDays
Expand Down Expand Up @@ -86,8 +87,8 @@ function dayWithinYear(date, cal){
function daysInYear(calArray){
return calArray.map(x => x.split(":")[1]).reduce((a, b) => +a + +b, 0)
}

//console.log(toHarrisDate("2 February 1901", "Gregorian"))
console.log(toHarrisDate("2 January 1900", "Gregorian"))
console.log(toHarrisDate("2 February 1901", "Gregorian"))

function getYear(year, cal){
/*
Expand Down

0 comments on commit 758dc1a

Please sign in to comment.