Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-18228

Add ordinal suffix to datetime function

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Obsolete
    • Icon: Medium Medium
    • None
    • 4.4.0, 4.5.0alpha, 4.5.0beta1, 4.5.0beta2
    • None
    • Operating System: All
      PHP Version: NA
      Database and version: NA
      Browser (and version): NA

    Description

      It would be very useful to have the ordinal suffix ('S' in php's date function) as an option on the eZ template language's datetime operator. This can be accomplished with the following patch to lib/ezlocale/classes/ezlocale.php

      lib/ezlocale/classes/ezlocale.php
      @@ -139,7 +139,7 @@ class eZLocale
               $this->TimePHPArray = array( 'g', 'G', 'h', 'H', 'i', 's', 'U', 'I', 'L
               $this->DatePHPArray = array( 'd', 'j', 'm', 'n', 'O', 'T', 'U', 'w', 'W
               $this->DateTimePHPArray = array( 'd', 'j', 'm', 'n', 'O', 'T', 'U', 'w'
      -                                         'g', 'G', 'h', 'H', 'i', 's', 'U', 'I'
      +                                         'g', 'G', 'h', 'H', 'i', 's', 'S', 'U'
               $this->TimeArray = preg_replace( '/.+/', '%$0', $this->TimePHPArray );
               $this->DateArray = preg_replace( '/.+/', '%$0', $this->DatePHPArray );
               $this->DateTimeArray = preg_replace( '/.+/', '%$0', $this->DateTimePHPA
      

      (simply add an 'S' element to DateTimePHPArray)

      Steps to reproduce

      None

      Attachments

        Activity

          People

            oms Ole Marius Smestad
            joekepley joekepley
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: