The new names are epochToRssDate and strToRssDate.
Don't refer to gmdate() in the function names, this is just an
implementation detail which should not have leaked into the external
interface, instead mention RssDate in the function names to communicate
something about the output they produce.
Also, while at it, user the DATE_RSS format when calling gmdate().
<xsl:value-of select="$item-permalink"/>
</guid>
<pubDate>
<xsl:value-of select="$item-permalink"/>
</guid>
<pubDate>
- <xsl:value-of select="php:functionString('Tweeper::strToGmdate', normalize-space(.//date))"/>
+ <xsl:value-of select="php:functionString('Tweeper::strToRssDate', normalize-space(.//date))"/>
</pubDate>
<description>
<xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text>
</pubDate>
<description>
<xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text>
</guid>
<pubDate>
<xsl:variable name="timestamp" select=".//abbr[@data-shorten]/@data-utime"/>
</guid>
<pubDate>
<xsl:variable name="timestamp" select=".//abbr[@data-shorten]/@data-utime"/>
- <xsl:value-of select="php:functionString('Tweeper::epochToGmdate', number($timestamp))"/>
+ <xsl:value-of select="php:functionString('Tweeper::epochToRssDate', number($timestamp))"/>
<xsl:variable name="day" select="substring($date, 4, 2)"/>
<xsl:variable name="year" select="substring($date, 7, 2)"/>
<xsl:variable name="iso-date" select="concat('20', $year, '-', $month, '-', $day)"/>
<xsl:variable name="day" select="substring($date, 4, 2)"/>
<xsl:variable name="year" select="substring($date, 7, 2)"/>
<xsl:variable name="iso-date" select="concat('20', $year, '-', $month, '-', $day)"/>
- <xsl:value-of select="php:functionString('Tweeper::strToGmdate', $iso-date)"/>
+ <xsl:value-of select="php:functionString('Tweeper::strToRssDate', $iso-date)"/>
</pubDate>
<description>
<xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text>
</pubDate>
<description>
<xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text>
</guid>
<pubDate>
<xsl:variable name="timestamp" select="./date"/>
</guid>
<pubDate>
<xsl:variable name="timestamp" select="./date"/>
- <xsl:value-of select="php:functionString('Tweeper::epochToGmdate', number($timestamp))"/>
+ <xsl:value-of select="php:functionString('Tweeper::epochToRssDate', number($timestamp))"/>
</pubDate>
<description>
<xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text>
</pubDate>
<description>
<xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text>
<xsl:value-of select="$item-permalink"/>
</guid>
<pubDate>
<xsl:value-of select="$item-permalink"/>
</guid>
<pubDate>
- <xsl:value-of select="php:functionString('Tweeper::strToGmdate', .//abbr[@class='easydate']/@title)"/>
+ <xsl:value-of select="php:functionString('Tweeper::strToRssDate', .//abbr[@class='easydate']/@title)"/>
</pubDate>
<description>
<xsl:value-of select="concat($user-name, ': ')"/>
</pubDate>
<description>
<xsl:value-of select="concat($user-name, ': ')"/>
</guid>
<pubDate>
<xsl:variable name="timestamp" select=".//span[contains(@class, 'js-short-timestamp')]/@data-time"/>
</guid>
<pubDate>
<xsl:variable name="timestamp" select=".//span[contains(@class, 'js-short-timestamp')]/@data-time"/>
- <xsl:value-of select="php:functionString('Tweeper::epochToGmdate', number($timestamp))"/>
+ <xsl:value-of select="php:functionString('Tweeper::epochToRssDate', number($timestamp))"/>
</pubDate>
<description>
<xsl:value-of select="concat($user-name, ': ')"/>
</pubDate>
<description>
<xsl:value-of select="concat($user-name, ': ')"/>
/**
* Convert numeric Epoch to the date format expected in a RSS document.
*/
/**
* Convert numeric Epoch to the date format expected in a RSS document.
*/
- public static function epochToGmdate($timestamp) {
+ public static function epochToRssDate($timestamp) {
if (!is_numeric($timestamp) || is_nan($timestamp)) {
$timestamp = 0;
}
if (!is_numeric($timestamp) || is_nan($timestamp)) {
$timestamp = 0;
}
- return gmdate('D, d M Y H:i:s', $timestamp) . ' GMT';
+ return gmdate(DATE_RSS, $timestamp);
}
/**
* Convert generic date string to the date format expected in a RSS document.
*/
}
/**
* Convert generic date string to the date format expected in a RSS document.
*/
- public static function strToGmdate($date) {
+ public static function strToRssDate($date) {
$timestamp = strtotime($date);
if (FALSE === $timestamp) {
$timestamp = 0;
}
$timestamp = strtotime($date);
if (FALSE === $timestamp) {
$timestamp = 0;
}
- return Tweeper::epochToGmdate($timestamp);
+ return Tweeper::epochToRssDate($timestamp);