Streaming live at 10am (PST)

Alter Date Field Format in Custom Code Embed

I don’t want the month of a custom date field in an Embed to be abbreviated.

I’m using custom code in an Embed element because I am forced to hack around the lack of support for dynamic fields in custom attributes in order to reference a date for the <time> element’s datetime attribute.

The code below—originally copied from the HTML Embed Code Editor with fields and pasted into Notepad—does give me the rearranged with hyphens format that I want to see as the datetime value when I inspect with Chrome DevTools. But if I try to change the display instance from MMM DD, YYYY both values break/disappear.

<time datetime="{{wf {&quot;path&quot;:&quot;release-date&quot;,&quot;transformers&quot;:[{&quot;name&quot;:&quot;date&quot;,&quot;arguments&quot;:[&quot;YYYY-MM-DD&quot;]\}],&quot;type&quot;:&quot;Date&quot;\} }}" itemprop="datePublished">{{wf {&quot;path&quot;:&quot;release-date&quot;,&quot;transformers&quot;:[{&quot;name&quot;:&quot;date&quot;,&quot;arguments&quot;:[&quot;MMM DD, YYYY&quot;]\}],&quot;type&quot;:&quot;Date&quot;\} }}</time>

I tried different date formats from the Internet to no avail, which I assume is my fault. However, it does seem buggy that I can successfully alter the format of the field in the element attribute, but not in the element content (even copying and pasting the exact same format/code).

Ah, also please consider voting for @jornaagaard’s Wishlist idea for dynamic custom attribute values at https://wishlist.webflow.com/ideas/WEBFLOW-I-728 and Dmitrii Tregubov’s idea for empty custom attribute values at https://wishlist.webflow.com/ideas/WEBFLOW-I-500.

That is better than creating duplicate Wishlist ideas, even though they are three years old, right?

This is definitely an issue. First, there should be a native element that allows for the auto definition of the datetime property and the innerHTML as well. Short of that the custom embed would work if you had the option to format the value of the date itself. I think you can change this with a text field, but there should be a way to do this in the embed field as well.