maybe fixed the double 29 oct problem

This commit is contained in:
skeeter 2000-10-03 01:34:28 +00:00
parent 5008306a5d
commit 28c23a4c17

View File

@ -48,7 +48,7 @@
$link = "edit_entry.php"; $link = "edit_entry.php";
echo "<TABLE BORDER=0 bgcolor=\"".$phpgw_info["theme"]["bg_color"]."\">"; echo "<TABLE BORDER=0 bgcolor=\"".$phpgw_info["theme"]["bg_color"]."\">";
$sun = get_sunday_before($thisyear, $thismonth, 1); $sun = get_sunday_before($thisyear, $thismonth, 1) + 7200;
$monthstart = mktime(2,0,0,$thismonth,1,$thisyear); $monthstart = mktime(2,0,0,$thismonth,1,$thisyear);
$monthend = mktime(2,0,0,$thismonth + 1,0,$thisyear); $monthend = mktime(2,0,0,$thismonth + 1,0,$thisyear);
@ -75,13 +75,12 @@
. "<td>" . lang("Sa") . "</td>" . "<td>" . lang("Sa") . "</td>"
. "</tr>"; . "</tr>";
for ($i = $sun; date("Ymd",$i) <= date ("Ymd",$monthend); for ($i = $sun; date("Ymd",$i) <= date("Ymd",$monthend); $i += (24 * 3600 * 7) ) {
$i += (24 * 3600 * 7) ) {
echo "<TR>"; echo "<TR>";
for ($j = 0; $j < 7; $j++) { for ($j = 0; $j < 7; $j++) {
$date = $i + ($j * 24 * 3600); $date = $i + ($j * 24 * 3600);
if (date("Ymd",$date) >= date ("Ymd",$monthstart) && date("Ymd",$date) <= date ("Ymd",$monthend)) { if (date("Ymd",$date) >= date("Ymd",$monthstart) && date("Ymd",$date) <= date("Ymd",$monthend) ) {
echo "<TD align=right>"; echo "<TD align=right>";
if (! $friendly) if (! $friendly)
echo "<a href=\"".$phpgw->link($link,"year=".date("Y",$date)."&month=".date("m",$date) echo "<a href=\"".$phpgw->link($link,"year=".date("Y",$date)."&month=".date("m",$date)
@ -269,9 +268,7 @@ function month_name ( $m ) {
if (date("d", $date) == date("d", $start)) { if (date("d", $date) == date("d", $start)) {
$ret[$n++] = $repeated_events[$i]; $ret[$n++] = $repeated_events[$i];
} }
} } else if ($repeated_events[$i][cal_type] == 'yearly') {
else if ($repeated_events[$i][cal_type] == 'yearly') {
$yrS = date("Y", $start); $yrS = date("Y", $start);
$yr = date("Y", $date); $yr = date("Y", $date);
@ -422,7 +419,6 @@ function month_name ( $m ) {
return $repeated_events; return $repeated_events;
} }
function get_sunday_before($year,$month,$day) function get_sunday_before($year,$month,$day)
{ {
$weekday = date("w", mktime(0,0,0,$month,$day,$year) ); $weekday = date("w", mktime(0,0,0,$month,$day,$year) );