Skip to content

Commit

Permalink
keep Messages sorted by year
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRDOrazio committed Mar 25, 2024
1 parent 538104f commit a530474
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions includes/LitCalAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -2948,6 +2948,8 @@ public function Init(){
// Save the state of the current Calendar calculation
$this->Cal->sortFestivities();
$CalBackup = clone( $this->Cal );
$Messages = $this->Messages;
$this->Messages = [];

// let's calculate the calendar for the previous year
$this->LitSettings->Year--;
Expand Down Expand Up @@ -2978,6 +2980,8 @@ public function Init(){

// let's reset the year back to the original request before outputting results
$this->LitSettings->Year++;
// and append the backed up messages
array_push( $this->Messages, ...$Messages );
$this->generateResponse();
}
else {
Expand Down

0 comments on commit a530474

Please sign in to comment.