Ordinal Suffix in Smarty Templates
This comment was split from the discussion: How can I change the name of my 3 products in 3 currencies to something more meaningful?
Hi Marc,
Another question:
How do you set the date format in emails to display the suffix for numbers to display: 1st, 2nd, 3rd, 4th.....21st and so on. We'd like to be able to tell users they will be billed on the x(th, rd, nd) day of the month.
Best,
Robin
Discussions are closed to public comments.
If you need help with Cheddar please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Marc Guyer on 15 Mar, 2013 01:25 PM
The email templates use Smarty syntax. Here's the reference:
http://www.smarty.net/docs/en/smarty.for.designers.tpl
You're looking for the data_format function:
http://www.smarty.net/docs/en/language.modifier.date.format.tpl
What is required to show the ordinal suffix is unfortunately not documented there. You can also use additional format syntax like PHP's date() function http://www.php.net/manual/en/function.date.php with the Smarty date_format function. So, if you want to use the ordinal suffix, you can do this:
Jess Pendley closed this discussion on 21 Nov, 2013 07:36 PM.