Skip to content

AMP_Allowed_Tags_Generated class is stripping amp-date-display {{iso}} format from amp-timeago component #3137

@robibuckley

Description

@robibuckley

When trying to convert a timestamp to an iso datetime format using an amp-date-display component with amp-mustache template the {{iso}} format is being stripped from the amp-timeago component by the datetime regex value in the AMP_Allowed_Tags_Generated class on line 5417

It would be good if the below could be allowed to work as it would give a degree of flexibility with regards to the type of datetime we can pass to amp-timeago (sometimes it's not possible to change the format of the date being consumed via an external api call etc)

<amp-date-display timestamp-seconds="1567062005" layout="fixed" width="360" height="20">
    <template type="amp-mustache">
        <amp-timeago class="m1"
        width="160"
        height="20"
        datetime="{{iso}}">&nbsp;</amp-timeago>
    </template>
</amp-date-display>

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions