- Issue created by @petednz
Wanted to see if this works with Drupal 10
Drop code in to custom module folder and update .info.yaml file to cover ^10
Enable module - no obvious errors
Add a date field and set to expose and 'in between' and date ranges
check preview but just see an empty field.
in logs see
TypeError: Cannot access offset of type string on string in Drupal\views\Plugin\views\filter\NumericFilter->valueForm() (line 314 of /srv/www/cws/my.cancersupport.org.au/web/core/modules/views/src/Plugin/views/filter/NumericFilter.php).
and
#0 /srv/www/cws/my.cancersupport.org.au/web/core/modules/views/src/Plugin/views/filter/Date.php(40): Drupal\views\Plugin\views\filter\NumericFilter->valueForm()
#1 /srv/www/cws/my.cancersupport.org.au/web/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php(969): Drupal\views\Plugin\views\filter\Date->valueForm()
#2 /srv/www/cws/my.cancersupport.org.au/web/modules/custom/date_with_defined_ranges/src/DateWithCustomRanges.php(122): Drupal\views\Plugin\views\filter\FilterPluginBase->buildExposedForm()
etc
Not asking for any help. just thought I should report my experience in case it saves others wondering if this works to.
Also in hindsight, i don't think this would be the solution i was hoping for, as i was not wanting this for an exposed date field, i just wanted to set a date range to be 'last month' and haven't figured another way of doing this with out-of-the-box Views.
Active
1.0
Code