eventsFromInterval('2 week'); // $events = $ical->eventsFromRange("23.04.2017 00:00 T", "30.04.2017 23:59 T"); $events = $ical->eventsFromRange($startDateIcs, $endDateIcs); $prev_dtstart = new \DateTime('@' . (int) $ical->iCalDateToUnixTimestamp(0)); $printdate = false; foreach ($events as $event){ $dtstart = new \DateTime('@' . (int) $ical->iCalDateToUnixTimestamp($event->dtstart_tz)); $description = $event->description; if($description != ""){ $description = str_replace("Kalender:Extern & Info", "", $description); $description = str_replace("Kalender:Hauptveranstaltungen - ", "", $description); $description = str_replace("Kalender:Hauptveranstaltungen", "", $description); $description = str_replace("Kalender:Weitere Veranstaltung", "", $description); $description = preg_replace('/^ - /', '', $description); //Remove " - " if at beginning of line $description = preg_replace('/^- /', '', $description); //Remove " - " if at beginning of line } if(trim($description) == trim($event->summary)){ //Ignore description as it is identically to summary $description = ""; } if($dtstart->format('N') == 7){ //sunday => bold, gray $isSunday = true; } else{ $isSunday = false; } if($dtstart->format('d.m') != $prev_dtstart->format('d.m')){ //new date => show weekday $isNewDay = true; } else{ $isNewDay = false; } if($dtstart->format('H:i') == "00:00"){ //full day event $isFullDayEvent = true; } else{ $isFullDayEvent = false; } ?> > format('d.m.Y')); // if(strcmp($a1, $a2) == 0){ // its the printing date, show a "heute" instead of the date if($printdate == false){ // its the printing date, show a "heute" instead of the date $printdate = true; // echo(""); echo(""); } else{ ?>
HeuteHeute bold echo(""); } if($isNewDay){ //new date => show weekday echo($weekdays[$dtstart->format('N') - 1]); } if($isSunday){ //Sunday => bold echo(""); } if($description != ""){ //make sure the column has the same number of lines in Word as the next column echo("
 "); } ?>
bold echo(""); } if($isNewDay){ //new date => show date echo($dtstart->format('d.m.')); } if($isSunday){ //Sunday => bold echo(""); } if($description != ""){ //make sure the column has the same number of lines in Word as the next column echo("
 "); } ?>
bold echo(""); } if(!$isFullDayEvent){ //not full day event => show time echo($dtstart->format('H:i')); } if($isSunday){ //Sunday => bold echo(""); } if($description != ""){ //make sure the column has the same number of lines in Word as the next column echo("
 "); } ?>
bold echo(""); } echo($event->summary); if($isSunday){ //Sunday => bold echo(""); } if($description != ""){ echo("
"); echo($description); echo(""); } ?>