changeset 14:ec1453cb74b8

Plus brutal, mais fonctionnel. Il semblerait que -1 % 12 retourne -1 en PHP, et pas 11...
author Franck Deroche <webmaster@defr.org>
date Fri, 26 Oct 2007 14:24:59 +0200
parents a8710e973155
children 3b7c1400f89a
files includes/class.skeleton.php
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/includes/class.skeleton.php	Fri Oct 26 13:59:39 2007 +0200
+++ b/includes/class.skeleton.php	Fri Oct 26 14:24:59 2007 +0200
@@ -109,7 +109,9 @@
        $cYear = $this->calendarYear;
        $nextMonth = ($cMonth % 12) + 1;
        $nextYear = ($nextMonth == 1) ? $cYear + 1 : $cYear;
-       $prevMonth = (($cMonth % 12) - 1) % 12;
+       $prevMonth = $cMonth - 1;
+       if($prevMonth == 0)
+       	 $prevMonth = 12;
        $prevYear = ($prevMonth == 12) ? $cYear - 1 : $cYear;
        $retVal = new Template('calendar.xml');
        $retVal->setParams(array(