aboutsummaryrefslogtreecommitdiffstats
path: root/functions/parse
diff options
context:
space:
mode:
authorJim Hu <jimhu@users.sourceforge.net>2008-12-25 18:45:26 +0000
committerJim Hu <jimhu@users.sourceforge.net>2008-12-25 18:45:26 +0000
commit52ba3b8146dd01c1c7d057359f4485aae5813124 (patch)
treec621fef680e5042594dc2bacfe84b37ffa95d031 /functions/parse
parent3b410264d50c0e4dbd7ded4fe951f832cc1b266c (diff)
downloadphpicalendar-52ba3b8146dd01c1c7d057359f4485aae5813124.tar.gz
phpicalendar-52ba3b8146dd01c1c7d057359f4485aae5813124.tar.bz2
phpicalendar-52ba3b8146dd01c1c7d057359f4485aae5813124.zip
progress on timezones and daylight time
Diffstat (limited to 'functions/parse')
-rw-r--r--functions/parse/end_vevent.php86
-rw-r--r--functions/parse/recur_functions.php3
2 files changed, 41 insertions, 48 deletions
diff --git a/functions/parse/end_vevent.php b/functions/parse/end_vevent.php
index 1dfe221..5970e65 100644
--- a/functions/parse/end_vevent.php
+++ b/functions/parse/end_vevent.php
@@ -320,7 +320,6 @@ foreach($recur_data as $recur_data_unixtime) {
} else {
$start_unixtime_tmp = mktime($recur_data_hour,$recur_data_minute,0,$recur_data_month,$recur_data_day,$recur_data_year);
$end_unixtime_tmp = $start_unixtime_tmp + $length;
-
if (($end_time >= $phpiCal_config->bleed_time) && ($bleed_check == '-1')) {
$start_tmp = strtotime(date('Ymd',$start_unixtime_tmp));
$end_date_tmp = date('Ymd',$end_unixtime_tmp);
@@ -339,57 +338,18 @@ foreach($recur_data as $recur_data_unixtime) {
$end_time_tmp = '2400';
$display_end_tmp = $end_time;
}
-
- // Let's double check the until to not write past it
- $until_check = $start_date_tmp.$time_tmp.'00';
- if (@$until > $until_check) {
- $master_array[$start_date_tmp][$time_tmp][$uid] = array (
- 'event_start' => $start_time_tmp,
- 'event_end' => $end_time_tmp,
- 'start_unixtime' => $start_unixtime_tmp,
- 'end_unixtime' => $end_unixtime_tmp,
- 'event_text' => $summary,
- 'event_length' => $length,
- 'event_overlap' => 0,
- 'description' => $description,
- 'status' => $status,
- 'class' => $class,
- 'spans_day' => true,
- 'location' => $location,
- 'organizer' => serialize($organizer),
- 'attendee' => serialize($attendee),
- 'calnumber' => $calnumber,
- 'calname' => $actual_calname,
- 'url' => $url,
- 'recur' => $recur);
- if (isset($display_end_tmp)){
- $master_array[$start_date_tmp][$time_tmp][$uid]['display_end'] = $display_end_tmp;
- }
- checkOverlap($start_date_tmp, $time_tmp, $uid);
- }
- $start_tmp = strtotime('+1 day',$start_tmp);
- }
- } else {
- if ($bleed_check == '-1') {
- $display_end_tmp = $end_time;
- $end_time_tmp1 = '2400';
-
- }
- if (!isset($end_time_tmp1)) $end_time_tmp1 = $end_time;
-
- // Let's double check the until to not write past it
- $master_array[($recur_data_date)][($hour.$minute)][$uid] = array (
- 'event_start' => $start_time,
- 'event_end' => $end_time_tmp1,
+ $master_array[$start_date_tmp][$time_tmp][$uid] = array (
+ 'event_start' => $start_time_tmp,
+ 'event_end' => $end_time_tmp,
'start_unixtime' => $start_unixtime_tmp,
'end_unixtime' => $end_unixtime_tmp,
- 'event_text' => $summary,
+ 'event_text' => $summary, #
'event_length' => $length,
'event_overlap' => 0,
'description' => $description,
'status' => $status,
'class' => $class,
- 'spans_day' => false,
+ 'spans_day' => true,
'location' => $location,
'organizer' => serialize($organizer),
'attendee' => serialize($attendee),
@@ -398,9 +358,41 @@ foreach($recur_data as $recur_data_unixtime) {
'url' => $url,
'recur' => $recur);
if (isset($display_end_tmp)){
- $master_array[($recur_data_date)][($hour.$minute)][$uid]['display_end'] = $display_end_tmp;
+ $master_array[$start_date_tmp][$time_tmp][$uid]['display_end'] = $display_end_tmp;
}
- checkOverlap($recur_data_date, ($hour.$minute), $uid);
+ checkOverlap($start_date_tmp, $time_tmp, $uid);
+ $start_tmp = strtotime('+1 day',$start_tmp);
+ }
+ } else {
+ if ($bleed_check == '-1') {
+ $display_end_tmp = $end_time;
+ $end_time_tmp1 = '2400';
+
+ }
+ if (!isset($end_time_tmp1)) $end_time_tmp1 = $end_time;
+ $master_array[($recur_data_date)][($hour.$minute)][$uid] = array (
+ 'event_start' => $start_time,
+ 'event_end' => $end_time_tmp1,
+ 'start_unixtime' => $start_unixtime_tmp,
+ 'end_unixtime' => $end_unixtime_tmp,
+ 'event_text' => $summary,
+ 'event_length' => $length,
+ 'event_overlap' => 0,
+ 'description' => $description,
+ 'status' => $status,
+ 'class' => $class,
+ 'spans_day' => false,
+ 'location' => $location,
+ 'organizer' => serialize($organizer),
+ 'attendee' => serialize($attendee),
+ 'calnumber' => $calnumber,
+ 'calname' => $actual_calname,
+ 'url' => $url,
+ 'recur' => $recur);
+ if (isset($display_end_tmp)){
+ $master_array[($recur_data_date)][($hour.$minute)][$uid]['display_end'] = $display_end_tmp;
+ }
+ checkOverlap($recur_data_date, ($hour.$minute), $uid);
}
}
diff --git a/functions/parse/recur_functions.php b/functions/parse/recur_functions.php
index e45f4aa..6a58d2d 100644
--- a/functions/parse/recur_functions.php
+++ b/functions/parse/recur_functions.php
@@ -28,6 +28,7 @@ function add_recur($times,$freq=''){
if (!is_array($times)) $times = array($times);
/*BYMONTH, BYWEEKNO, BYYEARDAY, BYMONTHDAY, BYDAY, BYHOUR,
BYMINUTE, BYSECOND and BYSETPOS*/
+#dump_times($times);
$times = restrict_bymonth($times,$freq);
# $times = restrict_byweekno($times,$freq);
$times = restrict_byyearday($times,$freq);
@@ -253,6 +254,6 @@ function dump_times($times){
global $summary;
echo "<pre>$summary times:";
#var_dump($times);
- foreach($times as $time) echo "\ndate:".date("Ymd his",$time);
+ foreach($times as $time) echo "\ndate:".date("Y-m-d H:i:s",$time);
echo "</pre>";
}

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