Daterange field support in AddocalGroupedView formatter

Created on 26 June 2025, about 1 month ago

Problem/Motivation

The "new plugin for grouping multiple dates in one button", contrary to what the class annotation states, does not support the daterange field_type, resulting in the following error:

TypeError: Drupal\datetime\Plugin\Field\FieldFormatter\DateTimeFormatterBase::setTimeZone(): Argument #1 ($date) must be of type Drupal\Core\Datetime\DrupalDateTime, Drupal\datetime_range\Plugin\Field\FieldType\DateRangeItem given

Steps to reproduce

When using a multiple daterange field with the addtocal_grouped_view formatter access a content that exposes this field.

Proposed resolution

Similar to what is already implemented at addtocal_view formatter, but instead of assuming the field type, select the start date of the first and the last range.

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡΅πŸ‡ΉPortugal joao.ramos.costa

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024