[Fusionforge-commits] r7293 - in branches/Branch_4_7/gforge: debian www/activity

Roland Mas lolando at libremir.placard.fr.eu.org
Thu Apr 2 15:15:08 CEST 2009


Author: lolando
Date: 2009-04-02 15:15:07 +0200 (Thu, 02 Apr 2009)
New Revision: 7293

Modified:
   branches/Branch_4_7/gforge/debian/changelog
   branches/Branch_4_7/gforge/www/activity/index.php
Log:
Fixed date printing and parsing in activity tab, where the expected
format for date input didn't match the one used for display (which
depended on locale).


Modified: branches/Branch_4_7/gforge/debian/changelog
===================================================================
--- branches/Branch_4_7/gforge/debian/changelog	2009-04-02 13:05:57 UTC (rev 7292)
+++ branches/Branch_4_7/gforge/debian/changelog	2009-04-02 13:15:07 UTC (rev 7293)
@@ -1,4 +1,4 @@
-gforge (4.7.2-3+3) experimental; urgency=low
+gforge (4.7.2-3+4) experimental; urgency=low
 
   * Quick fix for a bug in uploading attachments to forum posts.  A proper
     fix requires a change in the DB schema, and will be implemented in
@@ -6,8 +6,11 @@
   * Removed database password from a world-readable file.
   * Fixed require directives in cronjobs (again, this is only for the 4.7
     series as it won't be needed on trunk).
+  * Fixed date printing and parsing in activity tab, where the expected
+    format for date input didn't match the one used for display (which
+    depended on locale).
 
- -- Roland Mas <lolando at debian.org>  Thu, 02 Apr 2009 15:01:23 +0200
+ -- Roland Mas <lolando at debian.org>  Thu, 02 Apr 2009 15:14:05 +0200
 
 gforge (4.7.2-3) experimental; urgency=low
 

Modified: branches/Branch_4_7/gforge/www/activity/index.php
===================================================================
--- branches/Branch_4_7/gforge/www/activity/index.php	2009-04-02 13:05:57 UTC (rev 7292)
+++ branches/Branch_4_7/gforge/www/activity/index.php	2009-04-02 13:15:07 UTC (rev 7293)
@@ -21,15 +21,17 @@
 $end = getStringFromRequest("end_date");
 $show=getArrayFromRequest("show");
 
+$date_format = _('%Y-%m-%d') ;
+
 if (!$begin || $begin==0) {
 	$begin = (time()-(30*86400));
 } else {
-	$begin = strtotime($begin);
+	$begin = strptime ($begin, $date_format);
 }
 if (!$end || $end==0) {
-	$end = time();
+	$end = time ();
 } else {
-	$end=strtotime($end)+86400;
+	$end = strptime ($end, $date_format) + 86400;
 }
 if ($begin > $end) {
 	$endtmp=$end;
@@ -110,8 +112,8 @@
 </tr>
 <tr>
 	<td><?php echo $multiselect; ?></td>
-	<td valign="top"><input name="start_date" value="<?php echo date(_('Y-m-d'),$begin); ?>" size="10" maxlength="10" /></td>
-	<td valign="top"><input name="end_date" value="<?php echo date(_('Y-m-d'),$end); ?>" size="10" maxlength="10" /></td>
+	<td valign="top"><input name="start_date" value="<?php echo strftime($date_format,$begin); ?>" size="10" maxlength="10" /></td>
+	<td valign="top"><input name="end_date" value="<?php echo strftime($date_format,$end); ?>" size="10" maxlength="10" /></td>
 	<td valign="top"><input type="submit" name="submit" value="<?php echo _('Submit'); ?>"/></td>
 </tr>
 </table>
@@ -129,11 +131,11 @@
 	$j=0;
 	$last_day = 0;
 	while ($arr =& db_fetch_array($res)) {
-		if ($last_day != date('Y-M-d',$arr['activity_date'])) {
+		if ($last_day != strftime($date_format,$arr['activity_date'])) {
 		//	echo $HTML->listTableBottom($theader);
-			echo '<tr class="tableheading"><td colspan="3">'.date(_('Y-m-d'),$arr['activity_date']).'</td></tr>';
+			echo '<tr class="tableheading"><td colspan="3">'.strftime($date_format,$arr['activity_date']).'</td></tr>';
 		//	echo $HTML->listTableTop($theader);
-			$last_day=date('Y-M-d',$arr['activity_date']);
+			$last_day=strftime($date_format,$arr['activity_date']);
 		}
 		switch ($arr['section']) {
 			case 'commit': {




More information about the Fusionforge-commits mailing list