The hero-blog component's `date` prop needs to be a timestamp

Created on 17 September 2025, 24 days ago

Problem/Motivation

This is a workaround for a limitation of Canvas.

Ideally, the date prop of the hero-blog component would accept a simple Y-m-d string. Unfortunately, when you're mapping a timestamp field (like created) into that prop, all you've got is a timestamp.

Canvas has a way to convert prop values (adapters) but they're not yet supported and they won't be in time for 1.0. Trying to use them will result in a crashing UI in some situations.

So we have to map the timestamp directly into the prop. Unfortunately, Twig has no way to convert a timestamp to a formatted date because it passes raw date values into strtotime(), so we'll have to implement a pre-render callback that converts this prop, if it is an integer, to a Y-m-d value that can be passed to Twig's date filter.

πŸ“Œ Task
Status

Fixed

Version

1.0

Component

Canvas integration

Created by

πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024