File tree Expand file tree Collapse file tree 5 files changed +24
-16
lines changed Expand file tree Collapse file tree 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.
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
Original file line number Diff line number Diff line change 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 ],
Original file line number Diff line number Diff line change 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 ],
Original file line number Diff line number Diff line change 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 ],
Original file line number Diff line number Diff line change @@ -82,8 +82,12 @@ public function getDescription(string $resourceClass): array
8282
8383 private function getElasticSearchQueryRanges ($ property , $ filter ): array
8484 {
85+ if (null === $ this ->properties ) {
86+ throw new \InvalidArgumentException ('The property must be defined in the filter. ' );
87+ }
8588 if (!\is_array ($ filter )) {
86- $ operator = $ this ->config [$ property ]->limit ;
89+ $ fallbackOperator = $ this ->properties [$ property ];
90+ $ operator = $ this ->config [$ fallbackOperator ]->limit ;
8791 $ value = $ filter ;
8892 } else {
8993 $ operator = DateLimit::{array_key_first ($ filter )};
You can’t perform that action at this time.
0 commit comments