File tree 5 files changed +24
-16
lines changed
5 files changed +24
-16
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,10 @@ See [keep a changelog] for information about writing changes to this log.
8
8
9
9
## [ Unreleased]
10
10
11
+ ## [ 1.1.1] - 2025-03-28
12
+
13
+ - Fix date range filter error for updated field
14
+
11
15
## [ 1.1.0] - 2025-03-20
12
16
13
17
### Added
Original file line number Diff line number Diff line change 70
70
#[ApiFilter(
71
71
DateRangeFilter::class,
72
72
properties: [
73
- 'start ' => 'start ' ,
74
- 'end ' => 'end ' ,
75
- 'updated ' => 'start ' ,
73
+ 'start ' => 'gte ' ,
74
+ 'end ' => 'lte ' ,
75
+ 'updated ' => 'gte ' ,
76
76
],
77
77
// Arguments only exist to provide backward compatibility with filters originally defined by the DateFilter
78
78
arguments: [
79
79
'config ' => [
80
- 'start ' => [
80
+ 'gte ' => [
81
81
'limit ' => DateLimit::gte,
82
82
'throwOnInvalid ' => true ,
83
83
],
84
- 'end ' => [
84
+ 'lte ' => [
85
85
'limit ' => DateLimit::lte,
86
86
'throwOnInvalid ' => true ,
87
87
],
Original file line number Diff line number Diff line change 70
70
#[ApiFilter(
71
71
DateRangeFilter::class,
72
72
properties: [
73
- 'occurrences.start ' => 'start ' ,
74
- 'occurrences.end ' => 'end ' ,
75
- 'updated ' => 'start ' ,
73
+ 'occurrences.start ' => 'gte ' ,
74
+ 'occurrences.end ' => 'lte ' ,
75
+ 'updated ' => 'gte ' ,
76
76
],
77
77
// Arguments only exist to provide backward compatibility with filters originally defined by the DateFilter
78
78
arguments: [
79
79
'config ' => [
80
- 'start ' => [
80
+ 'gte ' => [
81
81
'limit ' => DateLimit::gte,
82
82
'throwOnInvalid ' => true ,
83
83
],
84
- 'end ' => [
84
+ 'lte ' => [
85
85
'limit ' => DateLimit::lte,
86
86
'throwOnInvalid ' => true ,
87
87
],
Original file line number Diff line number Diff line change 66
66
#[ApiFilter(
67
67
DateRangeFilter::class,
68
68
properties: [
69
- 'start ' => 'start ' ,
70
- 'end ' => 'end ' ,
71
- 'updated ' => 'start ' ,
69
+ 'start ' => 'gte ' ,
70
+ 'end ' => 'lte ' ,
71
+ 'updated ' => 'gte ' ,
72
72
],
73
73
// Arguments only exist to provide backward compatibility with filters originally defined by the DateFilter
74
74
arguments: [
75
75
'config ' => [
76
- 'start ' => [
76
+ 'gte ' => [
77
77
'limit ' => DateLimit::gte,
78
78
'throwOnInvalid ' => true ,
79
79
],
80
- 'end ' => [
80
+ 'lte ' => [
81
81
'limit ' => DateLimit::lte,
82
82
'throwOnInvalid ' => true ,
83
83
],
Original file line number Diff line number Diff line change @@ -82,8 +82,12 @@ public function getDescription(string $resourceClass): array
82
82
83
83
private function getElasticSearchQueryRanges ($ property , $ filter ): array
84
84
{
85
+ if (null === $ this ->properties ) {
86
+ throw new \InvalidArgumentException ('The property must be defined in the filter. ' );
87
+ }
85
88
if (!\is_array ($ filter )) {
86
- $ operator = $ this ->config [$ property ]->limit ;
89
+ $ fallbackOperator = $ this ->properties [$ property ];
90
+ $ operator = $ this ->config [$ fallbackOperator ]->limit ;
87
91
$ value = $ filter ;
88
92
} else {
89
93
$ operator = DateLimit::{array_key_first ($ filter )};
You can’t perform that action at this time.
0 commit comments