From c35649f1127a646c662a21a069c2031f24a772bd Mon Sep 17 00:00:00 2001 From: Jim Hu Date: Sun, 19 Mar 2006 08:17:18 +0000 Subject: fix bug [ 1362515 ] December Monthly View Corruption- shifting repeated events --- functions/date_functions.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'functions/date_functions.php') diff --git a/functions/date_functions.php b/functions/date_functions.php index 8cc8f90..3e5e4b8 100644 --- a/functions/date_functions.php +++ b/functions/date_functions.php @@ -49,16 +49,11 @@ function dateOfWeek($Ymd, $day) { // that differ between them. requires dateOfWeek() function weekCompare($now, $then) { global $week_start_day; - $sun_now = dateOfWeek($now, $week_start_day); - $sun_then = dateOfWeek($then, $week_start_day); + $sun_now = dateOfWeek($now, "Sunday"); + $sun_then = dateOfWeek($then, "Sunday"); $seconds_now = strtotime($sun_now); $seconds_then = strtotime($sun_then); - $diff_seconds = $seconds_now - $seconds_then; - $diff_minutes = $diff_seconds/60; - $diff_hours = $diff_minutes/60; - $diff_days = round($diff_hours/24); - $diff_weeks = $diff_days/7; - + $diff_weeks = round(($seconds_now - $seconds_then)/(60*60*24*7)); return $diff_weeks; } -- cgit v1.2.3