From: Chad <ch...@ch...> - 2002-10-17 07:46:46
|
Ive made a good bit of changes to the parser around DTSTART and DTEND. Everything appears to work and its much more flexable (for adding in time zone support). Let me know if it breaks anything, Ive checked all the sample calendars. what it looks like now: if (preg_match("/DTSTART/", $field)) { $data = ereg_replace('T', '', $data); $data = ereg_replace('Z', '', $data); if (preg_match("/DTSTART;VALUE=DATE/", $field)) { $allday_start = $data; } else { ereg ('([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{0,2})([0-9]{0,2})', $data, $regs); $start_date = $regs[1] . $regs[2] . $regs[3]; $start_time = $regs[4] . $regs[5]; } } elseif (preg_match("/DTEND/", $field)) { $data = ereg_replace('T', '', $data); $data = ereg_replace('Z', '', $data); if (preg_match("/DTEND;VALUE=DATE/", $field)) { $allday_end = $data; } else { ereg ('([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{0,2})([0-9]{0,2})', $data, $regs); $end_date = $regs[1] . $regs[2] . $regs[3]; $end_time = $regs[4] . $regs[5]; } Its case-sensitive at the moment, but should be easy to fix, this solves a problem where if TZID was not set, it would not have a start or end time. Night, Chad |