Skip to content

Commit

Permalink
Merge pull request #1987 from danskernesdigitalebibliotek/DDFBRA-348-…
Browse files Browse the repository at this point in the history
…eventlist-kan-ikke-vise-arrangementer-der-straekker-sig-over-flere-dage

DDFBRA-348 - Fix event visibility in `Event list - automatic`+ Premature "expiration" label on events
  • Loading branch information
kasperbirch1 authored Jan 28, 2025
2 parents 3f267a8 + 2b159c5 commit 735adeb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public function getSeriesDateString(EventSeries $event_series): string|null {
*/
public function getUpcomingEventIds(EventSeries $event_series): array {
$date = new DrupalDateTime();
$date->setTimezone(new \DateTimezone(DateTimeItemInterface::STORAGE_TIMEZONE));
$formatted = $date->format(DateTimeItemInterface::DATETIME_STORAGE_FORMAT);

// Find the next upcoming eventinstance in this series - e.g., the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ private function getEventInstanceIds(array $tags = [], array $categories = []):
return [];
}

$date = new DrupalDateTime('today');
$date = new DrupalDateTime('now');
$date->setTimezone(new \DateTimezone(DateTimeItemInterface::STORAGE_TIMEZONE));
$formatted_date = $date->format(DateTimeItemInterface::DATETIME_STORAGE_FORMAT);

Expand All @@ -479,7 +479,7 @@ private function getEventInstanceIds(array $tags = [], array $categories = []):
$query->condition('eid.status', 1);

// We only want events in the future (e.g. - active events).
$query->condition('eid.date__value', $formatted_date, '>=');
$query->condition('eid.date__end_value', $formatted_date, '>=');
$query->orderBy('eid.date__value', 'ASC');
// We know that we will never need more than the maximum items,
// so we will limit the query to this.
Expand Down

0 comments on commit 735adeb

Please sign in to comment.