Skip to content

Commit

Permalink
Merge pull request #490 from devgeniem/TMS-1010
Browse files Browse the repository at this point in the history
TMS-1010: Fix events-lift component sorting with recurring events
  • Loading branch information
eebbi authored Jan 31, 2024
2 parents 9287c81 + f247cbd commit c5cd0ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [1.54.5] - 2024-02-01

- TMS-977: Add 'clear form' button to event-search
- TMS-1010: Fix events-lift component sorting with recurring events

## [1.54.4] - 2024-01-15

Expand Down
13 changes: 6 additions & 7 deletions lib/Formatters/EventzFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,13 @@ public function format( array $layout ) : array {
return $layout;
}

if ( ! empty( $layout['manual_event_categories'] ) ) {
// Sort events by start datetime objects.
usort( $events, function( $a, $b ) {
return $a['start_date_raw'] <=> $b['start_date_raw'];
} );
// Sort events by start datetime objects.
usort( $events, function( $a, $b ) {
return $a['start_date_raw'] <=> $b['start_date_raw'];
} );

$events = array_slice( $events, 0, $layout['page_size'] );
}
// Show selected amount of events
$events = array_slice( $events, 0, $layout['page_size'] );

$layout['events'] = $this->format_events( $events, $layout['show_images'] );
$layout['classes'] = [
Expand Down

0 comments on commit c5cd0ec

Please sign in to comment.