mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 19:34:27 +02:00
Emulate %R in the date_format modifier on Windows
Thanks to Danilo Buerger
This commit is contained in:
5
NEWS
5
NEWS
@@ -1,3 +1,8 @@
|
||||
- emulate %R in the date_format modifier on windows (Danilo Buerger, boots)
|
||||
|
||||
Version 2.6.16 (Dec 1st, 2006)
|
||||
-------------------------------
|
||||
|
||||
- fixed replacement bug in trimwhitespace output filter that was introduced
|
||||
in the last release (Spuerhund, boots)
|
||||
|
||||
|
@@ -33,8 +33,8 @@ function smarty_modifier_date_format($string, $format="%b %e, %Y", $default_date
|
||||
if (substr(PHP_OS,0,3) == 'WIN') {
|
||||
$hours = strftime('%I', $string);
|
||||
$short_hours = ( $hours < 10 ) ? substr( $hours, -1) : $hours;
|
||||
$_win_from = array ('%e', '%T', '%D', '%l');
|
||||
$_win_to = array ('%#d', '%H:%M:%S', '%m/%d/%y', $short_hours);
|
||||
$_win_from = array ('%e', '%T', '%D', '%l', '%R');
|
||||
$_win_to = array ('%#d', '%H:%M:%S', '%m/%d/%y', $short_hours, '%H:%M');
|
||||
$format = str_replace($_win_from, $_win_to, $format);
|
||||
}
|
||||
if($string != '') {
|
||||
|
Reference in New Issue
Block a user