This function already exists in Horde_Date
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 5 Mar 2010 06:33:23 +0000 (23:33 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 5 Mar 2010 07:09:41 +0000 (00:09 -0700)
framework/Util/lib/Horde/Util.php
framework/Util/package.xml

index c6a0919..2a9549d 100644 (file)
@@ -35,28 +35,6 @@ class Horde_Util
     );
 
     /**
-     * TODO
-     *
-     * @var array
-     */
-    static public $dateSymbols = array(
-        'a', 'A', 'd', 'D', 'F', 'g', 'G', 'h', 'H', 'i', 'j', 'l', 'm', 'M',
-        'n', 'r', 's', 'T', 'w', 'W', 'y', 'Y', 'z', 'm/d/Y', 'M', "\n",
-        'g:i a', 'G:i', "\t", 'H:i:s', '%'
-    );
-
-    /**
-     * TODO
-     *
-     * @var array
-     */
-    static public $strftimeSymbols = array(
-        '%p', '%p', '%d', '%a', '%B', '%I', '%H', '%I', '%H', '%M', '%e',
-        '%A', '%m', '%b', '%m', '%a, %e %b %Y %T %Z', '%S', '%Z', '%w', '%V',
-        '%y', '%Y', '%j', '%D', '%h', '%n', '%r', '%R', '%t', '%T', '%%'
-    );
-
-    /**
      * Temp directory locations.
      *
      * @var array
@@ -775,45 +753,6 @@ class Horde_Util
     }
 
     /**
-     * Returns a format string to be used by strftime().
-     *
-     * @param string $format  A format string as used by date().
-     *
-     * @return string  A format string as similar as possible to $format.
-     */
-    static public function date2strftime($format)
-    {
-        $f_len = strlen($format);
-        $result = '';
-
-        for ($pos = 0; $pos < $f_len;) {
-            for ($symbol = 0, $symcount = count(self::$dateSymbols); $symbol < $symcount; ++$symbol) {
-                if (strpos($format, self::$dateSymbols[$symbol], $pos) === $pos) {
-                    $result .= self::$strftimeSymbols[$symbol];
-                    $pos += strlen(self::$dateSymbols[$symbol]);
-                    continue 2;
-                }
-            }
-            $result .= substr($format, $pos, 1);
-            ++$pos;
-        }
-
-        return $result;
-    }
-
-    /**
-     * Returns a format string to be used by date().
-     *
-     * @param string $format  A format string as used by strftime().
-     *
-     * @return string  A format string as similar as possible to $format.
-     */
-    static public function strftime2date($format)
-    {
-        return str_replace(self::$strftimeSymbols, self::$dateSymbols, $format);
-    }
-
-    /**
      * Utility function to obtain PATH_INFO information.
      *
      * @return string  The PATH_INFO string.
index b00b643..4246f2e 100644 (file)
@@ -29,7 +29,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
   <api>beta</api>
  </stability>
  <license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
- <notes>* Removed Horde_Util::closeWindowJs() and Horde_Util::nocacheUrl().
+ <notes>* Removed Horde_Util::strftime2date() and Horde_Util::date2strftime().
+ * Removed Horde_Util::closeWindowJs() and Horde_Util::nocacheUrl().
  * Added Horde_Util::convertToUtf8().
  * Added Horde_Util::abbreviate().
  * Removed Horde_Array::combine() and Horde_Util::hmac().