SmartDateTrait::augmentOutput requires timestamp

Created on 3 February 2025, 2 months ago

Problem/Motivation

I received this error:

InvalidArgumentException: The timestamp must be numeric. in Drupal\Component\Datetime\DateTimePlus::createFromTimestamp() (line 201 of core/lib/Drupal/Component/Datetime/DateTimePlus.php).
Drupal\smart_date\Plugin\Field\FieldFormatter\SmartDateDefaultFormatter->augmentOutput(Array, Array, '2025-02-07T19:00:00', '2025-02-16T10:00:00', 'Europe/London', 0) (Line: 162)

This relates to this existing todo:

        // @todo examine why we aren't using the $start_ts and $end_ts that are
        // already normalized above.
        $this->augmentOutput($elements[$delta], $augmenters['instances'], $item->value, $item->end_value, $timezone, $delta);

Steps to reproduce

Install date augmenter and an augmenter plugin.
Enable the smart date default formatter on a date range field.
View the output.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

4.2

Component

Code

Created by

🇬🇧United Kingdom jonathanshaw Stroud, UK

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