[pLog-svn] r682 - in plog/trunk: class/locale templates/blueish
ork at devel.plogworld.net
ork at devel.plogworld.net
Wed Jan 5 13:50:00 GMT 2005
Author: ork
Date: 2005-01-05 13:50:00 +0000 (Wed, 05 Jan 2005)
New Revision: 682
Modified:
plog/trunk/class/locale/locale.class.php
plog/trunk/templates/blueish/post.template
Log:
changed formatDate() so %d will actually be php compatible. added %j,
which will return the int value of the day (again like php date()).
changed bluish template to make use of %j
Modified: plog/trunk/class/locale/locale.class.php
===================================================================
--- plog/trunk/class/locale/locale.class.php 2005-01-05 10:28:07 UTC (rev 681)
+++ plog/trunk/class/locale/locale.class.php 2005-01-05 13:50:00 UTC (rev 682)
@@ -367,7 +367,8 @@
* <li>%A complete weekday</li>
* <li>%b abbreviated month</li>
* <li>%B long month</li>
- * <li>%d day of the month, numeric</li>
+ * <li>%d day of the month, 2 digits with leading zero</li>
+ * <li>%j day of the month, numeric (without leading zero)</li>
* <li>%H hours, in 24-h format</li>
* <li>%I hours, in 12-h format</li>
* <li>%p hours, in 12-h format including AM or PM</li>
@@ -399,8 +400,9 @@
$values["%A"] = $weekday;
$values["%b"] = substr($monthStr, 0, 3 );
$values["%B"] = $monthStr;
- $values["%d"] = $timeStamp->getDay();
- $values["%e"] = intval($timeStamp->getDay());
+ $values["%d"] = ($timeStamp->getDay() < 10) ? "0".$timeStamp->getDay() : $timeStamp->getDay();
+ $values["%e"] = intval($timeStamp->getDay());
+ $values["%j"] = $timeStamp->getDay();
$values["%H"] = $timeStamp->getHour();
$values["%I"] = $timeStamp->getHour() >= 12 ? $timeStamp->getHour()-12 : $timeStamp->getHour();
$values["%p"] = $timeStamp->getHour() >= 12 ? "pm" : "am";
Modified: plog/trunk/templates/blueish/post.template
===================================================================
--- plog/trunk/templates/blueish/post.template 2005-01-05 10:28:07 UTC (rev 681)
+++ plog/trunk/templates/blueish/post.template 2005-01-05 13:50:00 UTC (rev 682)
@@ -2,7 +2,7 @@
{assign var="postDate" value=$post->getDateObject()}
{assign var="postOwner" value=$post->getUserInfo()}
<div class="blog">
- <h2 class="date">{$locale->formatDate($postDate,"%d %b, %Y")}</h2>
+ <h2 class="date">{$locale->formatDate($postDate,"%j %b, %Y")}</h2>
<div class="blogbody">
<h2 class="title">{$post->getTopic()}</h2>
<div class="posted">{$locale->tr("posted_by")} {$postOwner->getUsername()} {$locale->formatDate($postDate,"%H:%M")} |
More information about the pLog-svn
mailing list