aboutsummaryrefslogtreecommitdiffstats
path: root/functions/date_functions.php
diff options
context:
space:
mode:
authorJim Hu <jimhu@users.sourceforge.net>2006-03-19 08:17:18 +0000
committerJim Hu <jimhu@users.sourceforge.net>2006-03-19 08:17:18 +0000
commitc35649f1127a646c662a21a069c2031f24a772bd (patch)
tree18c0bdccab3ce8a444df150ee696496a6eb265ed /functions/date_functions.php
parentc473c5498cdf70ae4a17bca9f7e88296246cf8ef (diff)
downloadphpicalendar-c35649f1127a646c662a21a069c2031f24a772bd.tar.gz
phpicalendar-c35649f1127a646c662a21a069c2031f24a772bd.tar.bz2
phpicalendar-c35649f1127a646c662a21a069c2031f24a772bd.zip
fix bug [ 1362515 ] December Monthly View Corruption- shifting repeated events
Diffstat (limited to 'functions/date_functions.php')
-rw-r--r--functions/date_functions.php11
1 files changed, 3 insertions, 8 deletions
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;
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy