wazo
January 13, 2010, 9:28am
1
Hi I have a issue in SMARTY
I cannot display (st,th,nd,rd,) after a date for example
23rd December 2009
it displays as
23 December 2009
How can I do this. I checked this page http://www.smarty.net/manual/en/language.modifier.date.format.php
But I cannot see a value for what I need
Thanks in advance
Regards
Chris
I am not good in smarty though, but since there is no such particular modifier with date_format so i would do something like this as per the requirement.
$date = date('jS F, Y');
$smarty->assign('my_date', $date);
PHPycho
January 13, 2010, 10:08am
3
If smarty date modifier doesn’t fulfill your requirement then you have to make a custom one.
Here’s one that i found after quick googling:
http://www.denisvlasov.net/155/adding-modifier-in-smarty-template-engine/
Edit:
Yes you can also tweak your requirement at logic layer(while assigning) like what rajug has mentioned