diff options
author | Jim Hu <jimhu@users.sourceforge.net> | 2006-11-02 08:06:03 +0000 |
---|---|---|
committer | Jim Hu <jimhu@users.sourceforge.net> | 2006-11-02 08:06:03 +0000 |
commit | 09643a5841c1cec29871e0b4d1eb4d6e10108a4b (patch) | |
tree | 9bc24cf07a31141ef3f172d2b7cf4128e3859b8d /functions | |
parent | 956548beab93780c028f79ce0c75d06093306f19 (diff) | |
download | phpicalendar-09643a5841c1cec29871e0b4d1eb4d6e10108a4b.tar.gz phpicalendar-09643a5841c1cec29871e0b4d1eb4d6e10108a4b.tar.bz2 phpicalendar-09643a5841c1cec29871e0b4d1eb4d6e10108a4b.zip |
bug fix for repeating events where first day of month is same as repeat day
Diffstat (limited to 'functions')
-rw-r--r-- | functions/ical_parser.php | 4 | ||||
-rw-r--r-- | functions/init.inc.php | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/functions/ical_parser.php b/functions/ical_parser.php index af1da64..b754d75 100644 --- a/functions/ical_parser.php +++ b/functions/ical_parser.php @@ -660,7 +660,7 @@ foreach ($cal_filelist as $cal_key=>$filename) { $last_day_tmp = date('t',$next_range_time); $next_range_time = strtotime(date('Y-m-'.$last_day_tmp, $next_range_time)); $last_tmp = (date('w',$next_range_time) == $on_day_num) ? '' : 'last '; - $next_date_time = strtotime($last_tmp.$on_day.' -'.$nth.' week', $next_range_time); + $next_date_time = strtotime($last_tmp.$on_day, $next_range_time) - $nth * 604800; $month = date('m', $next_date_time); if (in_array($month, $bymonth)) { $recur_data[] = $next_date_time; @@ -682,7 +682,7 @@ foreach ($cal_filelist as $cal_key=>$filename) { } } } elseif ((isset($byday_arr[1])) && ($byday_arr[1] != '-')) { - $next_date_time = strtotime($on_day.' +'.$nth.' week', $next_range_time); + $next_date_time = strtotime($on_day, $next_range_time) + $nth * 604800; $month = date('m', $next_date_time); if (in_array($month, $bymonth)) { $recur_data[] = $next_date_time; diff --git a/functions/init.inc.php b/functions/init.inc.php index 83b540e..c554f81 100644 --- a/functions/init.inc.php +++ b/functions/init.inc.php @@ -13,6 +13,7 @@ $ALL_CALENDARS_COMBINED = 'all_calendars_combined971'; // Pull in the configuration and some functions. if (!defined('BASE')) define('BASE', './'); +include_once(BASE.'default_config.inc.php'); include_once(BASE.'config.inc.php'); $cookie_name = 'phpicalendar_'.basename($default_path); |