- 🇨🇦Canada chrisck BC, Canada
Just reporting here that contextual_range_filter does work with Smart Date range field type. Make sure your contextual filters are enabled at
/admin/config/content/contextual-range-filter
Configure your smart date range field contextual filter as follows:
When the filter value is NOT available- Provide default value
- Type: PHP code
if (isset($entity['node'])) { // Get the date range $start_date = $entity['node']->field_smartdate_range->value; $end_date = $entity['node']->field_smartdate_range->end_value; $range = $start_date . '--' . $end_date; return $range; }
For lower limit range only:
if (isset($entity['node'])) { // Get the date range $start_date = $entity['node']->field_smartdate->value; $range = $start_date . '--'; return $range; }
Hope this helps someone.
- First commit to issue fork.