Talk:Holidays related to Easter: Difference between revisions

Content added Content deleted
 
Line 91: Line 91:


function getHolidaysDates(year, church) {
function getHolidaysDates(year, church) {
const
let Easter = getEasterDate(year, church, year < firstYearOfNewStyle ? 1 : 2);
Easter = getEasterDate(year, church, year < firstYearOfNewStyle ? 1 : 2),
const holidays = church == 1 ? OrthodoxHolidays : CatholicHolidays;
holidays = church == 1 ? OrthodoxHolidays : CatholicHolidays;
return year + ": " +
return year + ": " +
holidays.map(h => {
holidays.map(h => {
let d = new Date(year, Easter[1] - 1, Easter[0]);
const d = new Date(year, Easter[1] - 1, Easter[0]);
d.setDate(d.getDate() + h[1] - 1);
d.setDate(d.getDate() + h[1] - 1);
return h[0] + ": " + new Intl.DateTimeFormat("ru", { month: "numeric", day: "numeric" }).format(d);
return h[0] + ": " + new Intl.DateTimeFormat("ru", { month: "numeric", day: "numeric" }).format(d);