Details
-
Bug
-
Resolution: Obsolete
-
Medium
-
None
-
4.4.0
-
None
Description
The documentation states:
"... The following table reveals the different elements that can be used in a custom format. ..."
"%R Thu, 21 Dec 2000 16:01:07 +0200 RFC 2822 formated date"
that is not correct.
@see lib/ezlocale/classes/ezlocale.php
[...]
The following characters are not recognized in the format string:
- r - RFC 822 formatted date; e.g. "Thu, 21 Dec 2000 16:01:07 +0200" (added in PHP 4.0.4)
[...]
The "%r" would be very useful e.g. when creating RSS
<lastBuildDate>{currentdate()|datetime('custom', '%r')}</lastBuildDate>
simply adding the "r" to "DateTimePHPArray" worked for me to fix this problem ...
--- a/lib/ezlocale/classes/ezlocale.php +++ b/lib/ezlocale/classes/ezlocale.php @@ -139,7 +139,7 @@ class eZLocale $this->TimePHPArray = array( 'g', 'G', 'h', 'H', 'i', 's', 'U', 'I', 'L', 't' ); $this->DatePHPArray = array( 'd', 'j', 'm', 'n', 'O', 'T', 'U', 'w', 'W', 'Y', 'y', 'z', 'Z', 'I', 'L', 't' ); $this->DateTimePHPArray = array( 'd', 'j', 'm', 'n', 'O', 'T', 'U', 'w', 'W', 'Y', 'y', 'z', 'Z', - 'g', 'G', 'h', 'H', 'i', 's', 'U', 'I', 'L', 't', 'a' ); + 'g', 'G', 'h', 'H', 'i', 's', 'U', 'I', 'L', 't', 'a', 'r' ); $this->TimeArray = preg_replace( '/.+/', '%$0', $this->TimePHPArray ); $this->DateArray = preg_replace( '/.+/', '%$0', $this->DatePHPArray ); $this->DateTimeArray = preg_replace( '/.+/', '%$0', $this->DateTimePHPArray );