cvs: smarty /libs/plugins modifier.date_format.php

"Monte Ohrt" <[email protected]>
Newsgroups gmane.comp.php.cvs.smarty
Message-ID <cvsmohrt1087998970@cvsserver>
mohrt		Wed Jun 23 09:56:10 2004 EDT

  Modified files:              
    /smarty/libs/plugins	modifier.date_format.php 
  Log:
  display date_format %e, %T and %D as expected for windows
  
  
http://cvs.php.net/diff.php/smarty/libs/plugins/modifier.date_format.php?r1=1.10&r2=1.11&ty=u
Index: smarty/libs/plugins/modifier.date_format.php
diff -u smarty/libs/plugins/modifier.date_format.php:1.10 smarty/libs/plugins/modifier.date_format.php:1.11
--- smarty/libs/plugins/modifier.date_format.php:1.10	Fri Dec 19 12:18:56 2003
+++ smarty/libs/plugins/modifier.date_format.php	Wed Jun 23 09:56:10 2004
@@ -29,6 +29,11 @@
  */
 function smarty_modifier_date_format($string, $format="%b %e, %Y", $default_date=null)
 {
+    if (substr(PHP_OS,0,3) == 'WIN') {
+           $_win_from = array ('%e',  '%T',       '%D');
+           $_win_to   = array ('%#d', '%H:%M:%S', '%m/%d/%y');
+           $format = str_replace($_win_from, $_win_to, $format);
+    }
     if($string != '') {
         return strftime($format, smarty_make_timestamp($string));
     } elseif (isset($default_date) && $default_date != '') {

-- 
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.