Fixes date display in events longer than a single day (Closes #1583).
authorStéphane Jacob <sj@m4x.org>
Wed, 11 Apr 2012 18:36:38 +0000 (20:36 +0200)
committerStéphane Jacob <sj@m4x.org>
Wed, 11 Apr 2012 18:36:38 +0000 (20:36 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
ChangeLog
modules/xnetevents.php
modules/xnetevents/xnetevents.inc.php

index 387dc08..baace64 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -24,9 +24,10 @@ Bug/Wish:
         - #1571: Fixes the opening of the comments panel                   -GLN
 
     * XnetEvent:
+        - #1348: Keeps the amount paid when updating participation         -GLN
         - #1577: Fixes alternative payements given by admins               -GLN
         - #1578: Fixes deletion of people inscriptions                     -GLN
-        - #1348: Keeps the amount paid when updating participation         -GLN
+        - #1583: Fixes date display in events longer than a single day     -JAC
         - #1603: Fixes Xnet events edition for users without profile       -JAC
 
     * XnetGrp:
index f3bef60..a7c4f72 100644 (file)
@@ -114,7 +114,7 @@ class XnetEventsModule extends PLModule
         }
 
         $page->assign('archive', $archive);
-        $evenements = XDB::iterator('SELECT  e.*, LEFT(10, e.debut) AS first_day, LEFT(10, e.fin) AS last_day,
+        $evenements = XDB::iterator('SELECT  e.*, LEFT(e.debut, 10) AS first_day, LEFT(e.fin, 10) AS last_day,
                                              IF(e.deadline_inscription,
                                                      e.deadline_inscription >= LEFT(NOW(), 10),
                                                      1) AS inscr_open,
index fe20a8e..fd92d22 100644 (file)
@@ -31,7 +31,7 @@ function get_event_detail($eid, $item_id = false, $asso_id = null)
                                        IF(e.deadline_inscription,
                                           e.deadline_inscription >= LEFT(NOW(), 10),
                                           1) AS inscr_open,
-                                       LEFT(10, e.debut) AS start_day, LEFT(10, e.fin) AS last_day,
+                                       LEFT(e.debut, 10) AS first_day, LEFT(e.fin, 10) AS last_day,
                                        LEFT(NOW(), 10) AS now,
                                        ei.titre, e.subscription_notification
                                  FROM  group_events             AS e
@@ -323,8 +323,8 @@ function make_event_date(&$e)
 {
     $start     = strtotime($e['debut']);
     $end       = strtotime($e['fin']);
-    $first_day = @strtotime($e['first_day']);
-    $last_day  = strtotime($e['last_day']);
+    $first_day = $e['first_day'];
+    $last_day  = $e['last_day'];
 
     $date = "";
     if ($start && $end != $start) {