Skip to content

Commit

Permalink
Merge pull request #67 from zecm-via/bugfix/sorting-order-by-month
Browse files Browse the repository at this point in the history
[BUGFIX] Correct sorting within the year from newest/latest to oldest
  • Loading branch information
mschwemer authored Jan 22, 2024
2 parents cecf2e4 + b553856 commit d2e734b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Classes/Domain/Model/Publication.php
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,10 @@ public function setYear(string $year): self
*/
public function getMonth(): string
{
return $this->month;
if (!is_numeric($this->month)) {
return (string) (date_parse($this->month)['month'] ?: '');
}
return (string) ((int) $this->month);
}

/**
Expand Down

0 comments on commit d2e734b

Please sign in to comment.