рони,
<script>
function catholicDate(year) {
// [url]https://ru.wikipedia.org/wiki/Алгоритм_Гаусса_вычисления_даты_Пасхи[/url]
var a = year % 19,
b = year % 4,
c = year % 7,
k = Math.floor(year / 100),
p = Math.floor((13 + 8 * k) / 25),
q = Math.floor(k / 4),
m = (15 - p + k - q) % 30,
n = (4 + k - q) % 7,
d = (19 * a + m) % 30,
e = (2 * b + 4 * c + 6 * d + n) % 7;
if (d === 29 && e === 6) return new Date(year, 3, 19);
if (d === 28 && e === 6 && ((11 * m + 11) % 30 < 19)) return new Date(year, 3, 18);
if (d + e > 9) return new Date(year, 3, d + e - 9);
else return new Date(year, 2, 22 + d + e);
}
function orthodoxDate(year) {
// [url]https://ru.wikipedia.org/wiki/Алгоритм_Гаусса_вычисления_даты_Пасхи[/url]
var a = year % 19,
b = year % 4,
c = year % 7,
d = (19 * a + 15) % 30,
e = (2 * b + 4 * c + 6 * d + 6) % 7,
f = d + e;
// (по старому стилю) Если f ≤ 9, то Пасха будет праздноваться 22 + f марта; если f > 9, то Пасха будет праздноваться f — 9 апреля.
return f <= 9 ? new Date(year, 2, 22 + f) : new Date(year, 3, f - 9);
}
function Catholic_Easter(dt, days) {
const msday = 24*60*60*1000; // мс в сутках
return new Date(dt.getTime() + days * msday);
}
function Orthodox_Easter(dt, days) {
const msday = 24*60*60*1000; // мс в сутках
return new Date(dt.getTime() + days * msday);
}
// Все даты по григорианскому календарю<br>отображаем в едином формате
function formatDate(date) {
return date.toLocaleDateString("ru", {
weekday: "long",
day: "numeric",
month: "long",
year: "numeric"
}).replace(/^.?|,/g, function(v, i) {
return !i ? v.toUpperCase() : '<br>'
});
}
function getDifference(year) {
var razn = 0;
if (year >= 300 && year <= 499) razn = 1;
else if (year >= 500 && year <= 599) razn = 2;
else if (year >= 600 && year <= 699) razn = 3;
else if (year >= 700 && year <= 899) razn = 4;
else if (year >= 900 && year <= 999) razn = 5;
else if (year >= 1000 && year <= 1099) razn = 6;
else if (year >= 1100 && year <= 1299) razn = 7;
else if (year >= 1300 && year <= 1399) razn = 8;
else if (year >= 1400 && year <= 1499) razn = 9;
else if (year >= 1500 && year <= 1699) razn = 10;
else if (year >= 1700 && year <= 1799) razn = 11;
else if (year >= 1800 && year <= 1899) razn = 12;
else if (year >= 1900 && year <= 2099) razn = 13;
else if (year >= 2100 && year <= 2199) razn = 14;
else if (year >= 2200 && year <= 2299) razn = 15;
else if (year >= 2300 && year <= 2399) razn = 16;
else if (year >= 2500 && year <= 2599) razn = 17;
else if (year >= 2600 && year <= 2699) razn = 18;
else if (year >= 2700 && year <= 2899) razn = 19;
else if (year >= 2900 && year <= 2999) razn = 20;
else if (year >= 3000 && year <= 3099) razn = 21;
else if (year >= 3100 && year <= 3299) razn = 22;
else if (year >= 3300 && year <= 3399) razn = 23;
else if (year >= 3400 && year <= 3499) razn = 24;
else if (year >= 3500 && year <= 3699) razn = 25;
else if (year >= 3700 && year <= 3799) razn = 26;
else if (year >= 3800 && year <= 3899) razn = 27;
else if (year >= 3900 && year <= 4099) razn = 28;
return razn;
}
// Все даты по юлианскому календарю<br>отображаем в едином формате
function formatDate_ul(date) {
var razn = getDifference(date.getFullYear());
var arrNameDay = "Воскресенье,Понедельник,Вторник,Среда,Четверг,Пятница,Суббота".split(",");
var weekday = arrNameDay[(date.getDay() + razn) % 7] + "<br>";
return weekday + date.toLocaleDateString("ru", {
day: "numeric",
month: "long",
year: "numeric"
});
}
document.addEventListener("DOMContentLoaded", document_domcontentloaded);
function document_domcontentloaded() {
document.getElementById("YearEntry").value = new Date().getFullYear();
output();
document.getElementById("YearEntry").oninput = output;
}
function output() {
const year = +document.getElementById("YearEntry").value
var razn = getDifference(year);
const cathDate = catholicDate(year),
orthDate = orthodoxDate(year);
document.querySelectorAll(".Catholic_Easter_gr").innerHTML = formatDate(cathDate);
document.querySelectorAll(".Maslenitsa_Catholic_gr").innerHTML = formatDate(Catholic_Easter(cathDate, -49));
document.querySelectorAll(".palm_Sunday_Catholic_gr").innerHTML = formatDate(Catholic_Easter(cathDate, -7));
document.querySelectorAll(".Catholic_Radunitsa_gr").innerHTML = formatDate(Catholic_Easter(cathDate, 9));
document.querySelectorAll(".Catholic_Trinity_gr").innerHTML = formatDate(Catholic_Easter(cathDate, 49));
document.querySelectorAll(".Catholic_Easter_ul").innerHTML = formatDate_ul(Catholic_Easter(cathDate, -razn));
document.querySelectorAll(".Maslenitsa_Catholic_ul").innerHTML = formatDate_ul(Catholic_Easter(cathDate, -razn -49));
document.querySelectorAll(".palm_Sunday_Catholic_ul").innerHTML = formatDate_ul(Catholic_Easter(cathDate, -razn -7));
document.querySelectorAll(".Catholic_Radunitsa_ul").innerHTML = formatDate_ul(Catholic_Easter(cathDate, -razn +9));
document.querySelectorAll(".Catholic_Trinity_ul").innerHTML = formatDate_ul(Catholic_Easter(cathDate, -razn +49));
document.querySelectorAll(".Orthodox_Easter_gr").innerHTML = formatDate(Orthodox_Easter(orthDate, +razn));
document.querySelectorAll(".Maslenitsa_Orthodox_gr").innerHTML = formatDate(Orthodox_Easter(orthDate, +razn -49));
document.querySelectorAll(".palm_Sunday_Orthodox_gr").innerHTML = formatDate(Orthodox_Easter(orthDate, +razn -7));
document.querySelectorAll(".Orthodox_Radunitsa_gr").innerHTML = formatDate(Orthodox_Easter(orthDate, +razn +9));
document.querySelectorAll(".Orthodox_Trinity_gr").innerHTML = formatDate(Orthodox_Easter(orthDate, +razn +49));
document.querySelectorAll(".Orthodox_Easter_ul").innerHTML = formatDate_ul(orthodoxDate(year));
document.querySelectorAll(".Maslenitsa_Orthodox_ul").innerHTML = formatDate_ul(Orthodox_Easter(orthDate, -49));
document.querySelectorAll(".palm_Sunday_Orthodox_ul").innerHTML = formatDate_ul(Orthodox_Easter(orthDate, -7));
document.querySelectorAll(".Orthodox_Radunitsa_ul").innerHTML = formatDate_ul(Orthodox_Easter(orthDate, 9));
document.querySelectorAll(".Orthodox_Trinity_ul").innerHTML = formatDate_ul(Orthodox_Easter(orthDate, 49));
}
</script>
попробовала так, и не работает...