From: <ji...@us...> - 2006-02-15 15:41:37
|
Update of /cvsroot/phpicalendar/phpicalendar/rss In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16120/phpicalendar/rss Modified Files: rss.php Log Message: fix date calculation problems (I hope) Index: rss.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/rss/rss.php,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** rss.php 15 Feb 2006 08:28:17 -0000 1.36 --- rss.php 15 Feb 2006 15:41:24 -0000 1.37 *************** *** 27,31 **** $getdate = date("Ymd"); } ! switch ($rssview){ case 'day': --- 27,31 ---- $getdate = date("Ymd"); } ! # for all views, $fromdate is the first day to be shown and $todate should be the last day. switch ($rssview){ case 'day': *************** *** 49,56 **** $theyear = $_GET['year']; }else{ ! $theyear = date('Y'); } $fromdate = ($theyear*10000)+101; ! $todate = date("Ymd", strtotime($fromdate) + 365*60*60*24); $theview = $theyear; break; --- 49,56 ---- $theyear = $_GET['year']; }else{ ! $theyear = substr($getdate,0,4); } $fromdate = ($theyear*10000)+101; ! $todate = date("Ymd", strtotime($theyear*10000+1231)); $theview = $theyear; break; *************** *** 58,62 **** $fromdate = $getdate; $todate = date("Ymd", strtotime($getdate) + $_GET['days']*60*60*24); - #print "from:$fromdate to: $todate<br>"; $theview = $_GET['days']." days from ".date('n/d/Y',strtotime($fromdate)); break; --- 58,61 ---- *************** *** 64,68 **** $todate = $getdate; $fromdate = date("Ymd", strtotime($getdate) - $_GET['days']*60*60*24); - #print "from:$fromdate to: $todate<br>"; $theview = $_GET['days']." days before ".date('n/d/Y',strtotime($todate)); break; --- 63,66 ---- *************** *** 146,150 **** //generate the items ! $numdays = round((strtotime($todate) - strtotime($fromdate))/(60*60*24)+1); $thisdate = $fromdate; # start at beginning of date range, # note that usage of $thisdate is different from distribution --- 144,148 ---- //generate the items ! $numdays = round((strtotime($todate) - strtotime($fromdate))/(60*60*24))+1; $thisdate = $fromdate; # start at beginning of date range, # note that usage of $thisdate is different from distribution |