Hello everyone.
Is there a way to format the day suffix for a CMS date (i.e. the “th” in 13th, the “rd” in 3rd)?
Thanks in advance!
Hello everyone.
Is there a way to format the day suffix for a CMS date (i.e. the “th” in 13th, the “rd” in 3rd)?
Thanks in advance!
Hey Boon, can you give a few examples of the fully formatted date you trying to create?
You bet, thanks for responding.
I’m looking for this style format:
Feb 14th
Mar 3rd
June 2nd
Thanks again
Yes you can do that, but it either requires custom JS, or a embed field hack.
Here’s the hack approach.
EDIT: Just noticed you wrote “June”, not “Jun”. If you want the full month name use MMMM Do
( 4 M’s )
If you want to go the JS approach, I’ve added an SA5 attribute for this;
Just add the lib to your page, and then two custom attributes on the date element;
wfu-format-handler
= moment
wfu-format-date
= MMMM Do
For your date element, I recommend you set the date format to one of Webflow’s YYYY-MM-DD format options to ensure good parsing regardless of your locale.