Skip to content

Commit

Permalink
make sure sat mem BVM only Ordinary Time
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRDOrazio committed Mar 24, 2024
1 parent 4f478bf commit 925241d
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 28 deletions.
28 changes: 28 additions & 0 deletions includes/Festivity.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,5 +165,33 @@ public static function setLocale( string $locale ) : void {
self::$monthLong = IntlDateFormatter::create( $locale, IntlDateFormatter::MEDIUM, IntlDateFormatter::NONE, 'UTC', IntlDateFormatter::GREGORIAN, "MMMM" );
}
}
/**
* The following functions might be somehow useful
* Leaving them commented for the time being since we aren't actually using them
*
public static function isAdventSeason( Festivity $festivity ) {
return $festivity->liturgicalSeason !== null && $festivity->liturgicalSeason === LitSeason::ADVENT;
}
public static function isChristmasSeason( Festivity $festivity ) {
return $festivity->liturgicalSeason !== null && $festivity->liturgicalSeason === LitSeason::CHRISTMAS;
}
public static function isLentSeason( Festivity $festivity ) {
return $festivity->liturgicalSeason !== null && $festivity->liturgicalSeason === LitSeason::LENT;
}
public static function isEasterTriduum( Festivity $festivity ) {
return $festivity->liturgicalSeason !== null && $festivity->liturgicalSeason === LitSeason::EASTER_TRIDUUM;
}
public static function isEasterSeason( Festivity $festivity ) {
return $festivity->liturgicalSeason !== null && $festivity->liturgicalSeason === LitSeason::EASTER;
}
public static function isOrdinaryTime( Festivity $festivity ) {
return $festivity->liturgicalSeason !== null && $festivity->liturgicalSeason === LitSeason::ORDINARY_TIME;
}
*/

}
26 changes: 1 addition & 25 deletions includes/FestivityCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public function removeFestivity( string $key ) :void {
unset( $this->festivities[ $key ] );
}

private function inOrdinaryTime( LitDateTime $date ) : bool {
public function inOrdinaryTime( LitDateTime $date ) : bool {
return (
( $date > $this->festivities[ "BaptismLord" ]->date && $date < $this->festivities[ "AshWednesday" ]->date )
||
Expand Down Expand Up @@ -542,28 +542,4 @@ public static function psalterWeek( int $weekOfOrdinaryTimeOrSeason ) : int {
return $weekOfOrdinaryTimeOrSeason % 4 === 0 ? 4 : $weekOfOrdinaryTimeOrSeason % 4;
}

public function isAdventSeason( Festivity $festivity ) {
return $festivity->liturgicalSeason === LitSeason::ADVENT;
}

public function isChristmasSeason( Festivity $festivity ) {
return $festivity->liturgicalSeason === LitSeason::CHRISTMAS;
}

public function isLentSeason( Festivity $festivity ) {
return $festivity->liturgicalSeason === LitSeason::LENT;
}

public function isEasterTriduum( Festivity $festivity ) {
return $festivity->liturgicalSeason === LitSeason::EASTER_TRIDUUM;
}

public function isEasterSeason( Festivity $festivity ) {
return $festivity->liturgicalSeason === LitSeason::EASTER;
}

public function isOrdinaryTime( Festivity $festivity ) {
return $festivity->liturgicalSeason === LitSeason::ORDINARY_TIME;
}

}
11 changes: 8 additions & 3 deletions includes/LitCalAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,7 @@ private function calculateFeastsMarySaints() : void {
//with the approval of Pope Francis elevated the memorial of Saint Mary Magdalen to a Feast
//source: http://www.vatican.va/roman_curia/congregations/ccdds/documents/articolo-roche-maddalena_it.pdf
//This is taken care of ahead when the "memorials from decrees" are applied
// see :MEMORIALS_FROM_DECREES

}

Expand Down Expand Up @@ -1951,7 +1952,7 @@ private function calculateSaturdayMemorialBVM() : void {
$SatMemBVM_cnt = 0;
while( $currentSaturday <= $lastSatDT ){
$currentSaturday = LitDateTime::createFromFormat( '!j-n-Y', $currentSaturday->format( 'j-n-Y' ),new DateTimeZone( 'UTC' ) )->modify( 'next Saturday' );
if( $this->Cal->notInSolemnitiesFeastsOrMemorials( $currentSaturday ) ) {
if( $this->Cal->inOrdinaryTime( $currentSaturday ) && $this->Cal->notInSolemnitiesFeastsOrMemorials( $currentSaturday ) ) {
$memID = "SatMemBVM" . ++$SatMemBVM_cnt;
$name = $this->LitSettings->Locale === LitLocale::LATIN ? "Memoria Sanctæ Mariæ in Sabbato" : _( "Saturday Memorial of the Blessed Virgin Mary" );
$festivity = new Festivity( $name, $currentSaturday, LitColor::WHITE, LitFeastType::MOBILE, LitGrade::MEMORIAL_OPT, LitCommon::BEATAE_MARIAE_VIRGINIS );
Expand Down Expand Up @@ -2462,6 +2463,7 @@ private function calculateUniversalCalendar() : void {
$this->calculateMemorials( LitGrade::MEMORIAL, RomanMissal::EDITIO_TYPICA_TERTIA_EMENDATA_2008 );
}

// :MEMORIALS_FROM_DECREES
$this->loadMemorialsFromDecreesData();
$this->applyDecrees( LitGrade::MEMORIAL );

Expand Down Expand Up @@ -2499,8 +2501,8 @@ private function calculateUniversalCalendar() : void {
$this->calculateWeekdaysOrdinaryTime();

//15. On Saturdays in Ordinary Time when there is no obligatory memorial, an optional memorial of the Blessed Virgin Mary is allowed.
$this->calculateSaturdayMemorialBVM();

// We will handle this after having set National and Diocesan calendar data
// see :SATURDAY_MEMORIAL_BVM
}

private function interpretStrtotime( object $row, string $key ) : LitDateTime|false {
Expand Down Expand Up @@ -2937,6 +2939,9 @@ public function Init(){
$this->applyDiocesanCalendar();
}

// :SATURDAY_MEMORIAL_BVM
$this->calculateSaturdayMemorialBVM();

$this->Cal->setCyclesVigilsSeasons();
$this->generateResponse();
}
Expand Down

0 comments on commit 925241d

Please sign in to comment.