incubator-olio-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ak...@apache.org
Subject svn commit: r766931 - /incubator/olio/webapp/php/trunk/public_html/calendar.php
Date Tue, 21 Apr 2009 00:46:06 GMT
Author: akara
Date: Tue Apr 21 00:46:06 2009
New Revision: 766931

URL: http://svn.apache.org/viewvc?rev=766931&view=rev
Log:
Issue OLIO-18: Patch submitted by Damien Cooke and Nick Lanham. Fix verified.

Modified:
    incubator/olio/webapp/php/trunk/public_html/calendar.php

Modified: incubator/olio/webapp/php/trunk/public_html/calendar.php
URL: http://svn.apache.org/viewvc/incubator/olio/webapp/php/trunk/public_html/calendar.php?rev=766931&r1=766930&r2=766931&view=diff
==============================================================================
--- incubator/olio/webapp/php/trunk/public_html/calendar.php (original)
+++ incubator/olio/webapp/php/trunk/public_html/calendar.php Tue Apr 21 00:46:06 2009
@@ -57,8 +57,32 @@
 }
 $prev_year= $year-1;
 $next_year= $year+1;
+//$prev_month = $month-1;
+//$next_month = $month+1;
+
+//$prev_month = $month==1?12:$month-1;
+//$next_month = $month==12?1:$month+1;
+
+switch($month)
+ {
+     case 1:
+           //this is the first month of the year
+           $prev_month = 12;
+           $next_month = $month+1;
+           break;
+
+     case 12:
+           //this is the last month of the year
+          $prev_month = $month -1;
+          $next_month = 1;
+         break;
+
+     default:
+         //all other cases
 $prev_month = $month-1;
 $next_month = $month+1;
+        break;
+ }
 
 ob_start();
 require("../views/calendar.php");



Mime
View raw message