From e5727749ce4c2af35a19f43c6cc98f9c04839309 Mon Sep 17 00:00:00 2001 From: skeeter Date: Thu, 16 Nov 2000 01:49:51 +0000 Subject: [PATCH] week view now reflects correct days viewed --- calendar/week.php | 20 ++++++++++++++------ doc/CHANGELOG | 3 +++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/calendar/week.php b/calendar/week.php index cc2b7183a8..21ce157fd4 100755 --- a/calendar/week.php +++ b/calendar/week.php @@ -22,6 +22,9 @@ $phpgw_info["flags"]["currentapp"] = "calendar"; include("../header.inc.php"); + if(!isset($phpgw_info["user"]["preferences"]["calendar"]["weekdaystarts"])) + $phpgw_info["user"]["preferences"]["calendar"]["weekdaystarts"] = "Sunday"; + if (isset($date) && strlen($date) > 0) { $thisyear = substr($date, 0, 4); $thismonth = substr($date, 4, 2); @@ -47,8 +50,13 @@ $nextmonth = $phpgw->calendar->splitdate(mktime(2,0,0,$thismonth + 1,1,$thisyear)); $prevmonth = $phpgw->calendar->splitdate(mktime(2,0,0,$thismonth - 1,1,$thisyear)); - $sun = $phpgw->calendar->splitdate($phpgw->calendar->get_sunday_before($thisyear, $thismonth, $thisday) + 7200); - $sat = $phpgw->calendar->splitdate($sun["raw"] + 604800); + if($phpgw_info["user"]["preferences"]["calednar"]["workweekstarts"] == "Sunday") { + $start = 7200; + } else { + $start = 93600; + } + $first = $phpgw->calendar->splitdate($phpgw->calendar->get_sunday_before($thisyear, $thismonth, $thisday) + $start); + $last = $phpgw->calendar->splitdate($first["raw"] + 518400); if ($friendly) { echo ""; @@ -81,11 +89,11 @@ ?> "> $sat["month"] && $sun["year"] <> $sat["year"]) echo ", ".$sun["year"]; + echo lang(strftime("%B",$first["raw"]))." ".$first["day"]; + if($first["month"] <> $last["month"] && $first["year"] <> $last["year"]) echo ", ".$first["year"]; echo " - "; - if($sun["month"] <> $sat["month"]) echo lang(strftime("%B",$sat["raw"]))." "; - echo $sat["day"].", ".$sat["year"]; + if($first["month"] <> $last["month"]) echo lang(strftime("%B",$last["raw"]))." "; + echo $last["day"].", ".$last["year"]; ?> "> diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 9c30f61e9f..33a9477a78 100755 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -1,3 +1,6 @@ +[0.9.4] - Fixed calendar week view. + - Displays calendar items in day view without start times. + [0.9.3] - Fixed the new user account form not returning the users firstname or last name when an error is reported. - Fixed NNTP to handle new VFS api.