Skip to content

Commit

Permalink
christmas weekdays should not be created when oblig memorial
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRDOrazio committed Dec 6, 2024
1 parent b9b9785 commit a8ca477
Showing 1 changed file with 26 additions and 24 deletions.
50 changes: 26 additions & 24 deletions src/Paths/Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ private function calculateChristmasWeekdaysThroughEpiphany(): void
$i . '-1-' . $this->CalendarParams->Year,
new \DateTimeZone('UTC')
);
if (false === self::dateIsSunday($dateTime)) {
if (false === self::dateIsSunday($dateTime) && $this->Cal->notInSolemnitiesFeastsOrMemorials($dateTime)) {
$nth++;
$locale = LitLocale::$PRIMARY_LANGUAGE;
$dayOfTheWeek = $locale === LitLocale::LATIN_PRIMARY_LANGUAGE
Expand Down Expand Up @@ -1135,30 +1135,32 @@ private function calculateChristmasWeekdaysAfterEpiphany(): void
$i . '-1-' . $this->CalendarParams->Year,
new \DateTimeZone('UTC')
);
$locale = LitLocale::$PRIMARY_LANGUAGE;
$dayOfTheWeek = $locale === LitLocale::LATIN_PRIMARY_LANGUAGE
? LatinUtils::LATIN_DAYOFTHEWEEK[ $dateTime->format('w') ]
: ( $locale === 'it'
? $this->dayAndMonth->format($dateTime->format('U'))
: ucfirst($this->dayOfTheWeek->format($dateTime->format('U')))
);
$name = $locale === LitLocale::LATIN_PRIMARY_LANGUAGE
? sprintf("%s temporis Nativitatis", $dayOfTheWeek)
: ( $locale === 'it'
? sprintf("Feria propria del %s", $dayOfTheWeek)
: sprintf(
/**translators: days after Epiphany when Epiphany falls on Jan 6 (not useful in Italian!) */
_("%s - Christmas Weekday"),
ucfirst($dayOfTheWeek)
)
if ($this->Cal->notInSolemnitiesFeastsOrMemorials($dateTime)) {
$locale = LitLocale::$PRIMARY_LANGUAGE;
$dayOfTheWeek = $locale === LitLocale::LATIN_PRIMARY_LANGUAGE
? LatinUtils::LATIN_DAYOFTHEWEEK[ $dateTime->format('w') ]
: ( $locale === 'it'
? $this->dayAndMonth->format($dateTime->format('U'))
: ucfirst($this->dayOfTheWeek->format($dateTime->format('U')))
);
$name = $locale === LitLocale::LATIN_PRIMARY_LANGUAGE
? sprintf("%s temporis Nativitatis", $dayOfTheWeek)
: ( $locale === 'it'
? sprintf("Feria propria del %s", $dayOfTheWeek)
: sprintf(
/**translators: days after Epiphany when Epiphany falls on Jan 6 (not useful in Italian!) */
_("%s - Christmas Weekday"),
ucfirst($dayOfTheWeek)
)
);
$festivity = new Festivity(
$name,
$dateTime,
LitColor::WHITE,
LitFeastType::MOBILE
);
$festivity = new Festivity(
$name,
$dateTime,
LitColor::WHITE,
LitFeastType::MOBILE
);
$this->Cal->addFestivity("DayAfterEpiphany" . $nth, $festivity);
$this->Cal->addFestivity("DayAfterEpiphany" . $nth, $festivity);
}
}
}

Expand Down

0 comments on commit a8ca477

Please sign in to comment.