SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru
    Join Date
    Oct 2004
    Location
    uk
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smarty date issue

    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/lang...ate.format.php


    But I cannot see a value for what I need

    Thanks in advance


    Regards


    Chris

  2. #2
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.
    PHP Code:
    $date date('jS F, Y');
    $smarty->assign('my_date'$date); 
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  3. #3
    SitePoint Wizard PHPycho's Avatar
    Join Date
    Dec 2005
    Posts
    1,201
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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/addin...mplate-engine/

    Edit:
    Yes you can also tweak your requirement at logic layer(while assigning) like what rajug has mentioned


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •