diff options
author | jwangen <jwangen> | 2002-09-21 20:43:57 +0000 |
---|---|---|
committer | jwangen <jwangen> | 2002-09-21 20:43:57 +0000 |
commit | f630d8cd1886b541d5a86a4d645bea69c6532777 (patch) | |
tree | 3547ad4abc7e238861d09d733d18f8edae4e50da /ical_parser.php | |
parent | f151681be71ef6d144812019a643d7886a1a6c24 (diff) | |
download | phpicalendar-f630d8cd1886b541d5a86a4d645bea69c6532777.tar.gz phpicalendar-f630d8cd1886b541d5a86a4d645bea69c6532777.tar.bz2 phpicalendar-f630d8cd1886b541d5a86a4d645bea69c6532777.zip |
made modifications to config, ical_parser, init, and list_icals
mostly just to convert "32" to spaces and maybe a few other small things
Diffstat (limited to 'ical_parser.php')
-rw-r--r-- | ical_parser.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ical_parser.php b/ical_parser.php index bb5fd8d..38e8bf4 100644 --- a/ical_parser.php +++ b/ical_parser.php @@ -13,8 +13,9 @@ include("./functions/date_add.php"); // and returns the date of that day. This function may be specific to WEEKLY recurring events. function dateOfWeek($Ymd, $day) { + global $week_start_day; $timestamp = strtotime($Ymd); - $sunday = strtotime((date("w",$timestamp)==0 ? "sun" : "last sun"), $timestamp); + $sunday = strtotime((date("w",$timestamp)==0 ? "$week_start_day" : "last $week_start_day"), $timestamp); if ($day == "SU") $day_longer = "sun"; elseif ($day == "MO") $day_longer = "mon"; elseif ($day == "TU") $day_longer = "tue"; @@ -28,8 +29,10 @@ function dateOfWeek($Ymd, $day) { // function to compare to dates in Ymd and return the number of weeks that differ between them // requires dateOfWeek() function weekCompare($now, $then) { - $sun_now = dateOfWeek($now, "SU"); - $sun_then = dateOfWeek($then, "SU"); + global $week_start_day; + $day = substr($week_start_day, 0, 2); + $sun_now = dateOfWeek($now, $day); + $sun_then = dateOfWeek($then, $day); $seconds_now = strtotime($sun_now); $seconds_then = strtotime($sun_then); $diff_seconds = $seconds_now - $seconds_then; @@ -42,7 +45,6 @@ function weekCompare($now, $then) { $day_array = array ("0700", "0730", "0800", "0830", "0900", "0930", "1000", "1030", "1100", "1130", "1200", "1230", "1300", "1330", "1400", "1430", "1500", "1530", "1600", "1630", "1700", "1730", "1800", "1830", "1900", "1930", "2000", "2030", "2100", "2130", "2200", "2230", "2300", "2330"); - // what date we want to get data for (for day calendar) if (!$getdate) $getdate = date("Ymd"); ereg ("([0-9]{4})([0-9]{2})([0-9]{2})", $getdate, $day_array2); |