Skip to content

Commit 980e3b8

Browse files
committed
3879: Fix date range filter error for updated field
1 parent c7c48b5 commit 980e3b8

File tree

5 files changed

+21
-16
lines changed

5 files changed

+21
-16
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ See [keep a changelog] for information about writing changes to this log.
88

99
## [Unreleased]
1010

11+
## [1.1.1] - 2025-03-28
12+
13+
- Fix date range filter error for updated field
14+
1115
## [1.1.0] - 2025-03-20
1216

1317
### Added

src/Api/Dto/DailyOccurrence.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,18 @@
7070
#[ApiFilter(
7171
DateRangeFilter::class,
7272
properties: [
73-
'start' => 'start',
74-
'end' => 'end',
75-
'updated' => 'start',
73+
'start' => 'gte',
74+
'end' => 'lte',
75+
'updated' => 'gte',
7676
],
7777
// Arguments only exist to provide backward compatibility with filters originally defined by the DateFilter
7878
arguments: [
7979
'config' => [
80-
'start' => [
80+
'gte' => [
8181
'limit' => DateLimit::gte,
8282
'throwOnInvalid' => true,
8383
],
84-
'end' => [
84+
'lte' => [
8585
'limit' => DateLimit::lte,
8686
'throwOnInvalid' => true,
8787
],

src/Api/Dto/Event.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,18 @@
7070
#[ApiFilter(
7171
DateRangeFilter::class,
7272
properties: [
73-
'occurrences.start' => 'start',
74-
'occurrences.end' => 'end',
75-
'updated' => 'start',
73+
'occurrences.start' => 'gte',
74+
'occurrences.end' => 'lte',
75+
'updated' => 'gte',
7676
],
7777
// Arguments only exist to provide backward compatibility with filters originally defined by the DateFilter
7878
arguments: [
7979
'config' => [
80-
'start' => [
80+
'gte' => [
8181
'limit' => DateLimit::gte,
8282
'throwOnInvalid' => true,
8383
],
84-
'end' => [
84+
'lte' => [
8585
'limit' => DateLimit::lte,
8686
'throwOnInvalid' => true,
8787
],

src/Api/Dto/Occurrence.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,18 @@
6666
#[ApiFilter(
6767
DateRangeFilter::class,
6868
properties: [
69-
'start' => 'start',
70-
'end' => 'end',
71-
'updated' => 'start',
69+
'start' => 'gte',
70+
'end' => 'lte',
71+
'updated' => 'gte',
7272
],
7373
// Arguments only exist to provide backward compatibility with filters originally defined by the DateFilter
7474
arguments: [
7575
'config' => [
76-
'start' => [
76+
'gte' => [
7777
'limit' => DateLimit::gte,
7878
'throwOnInvalid' => true,
7979
],
80-
'end' => [
80+
'lte' => [
8181
'limit' => DateLimit::lte,
8282
'throwOnInvalid' => true,
8383
],

src/Api/Filter/ElasticSearch/DateRangeFilter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ public function getDescription(string $resourceClass): array
8383
private function getElasticSearchQueryRanges($property, $filter): array
8484
{
8585
if (!\is_array($filter)) {
86-
$operator = $this->config[$property]->limit;
86+
$fallbackOperator = $this->properties[$property];
87+
$operator = $this->config[$fallbackOperator]->limit;
8788
$value = $filter;
8889
} else {
8990
$operator = DateLimit::{array_key_first($filter)};

0 commit comments

Comments
 (0)