Quote from: ejcross at Mar 01, 2007, 05:55 PM
Ok, thanks! I will play around with that and see what it does.
As for the feed with recurring events, I am trying to figure it out also. When you parse the date in the snippet, is it pulling data for the Starting Day (which in recurring events I assume is the created on day) or is it pulling for the First Start day (which is what the recurring event date actually is)?
Where would I find it in the snippet and other files for this?
Thanks!
For recurring events it just doesn’t parse the date at all.
Description to be parsed:
Recurring Event
First start: 2007-03-03 EST
Duration: 86400
Where: A shift - on duty
Event Status: confirmed
Event Description: Lt. Webster, Lt. Jones, FFM Adams, FFE Maher, FFE Weaver, FFE Schwanenberger
To parse the date, I look for the text string "When:"
Look at this code here if you want to try and do something with recurring events:
// Extract the 'when' information from the item summary, and ignore everything else
$from = textBetween("When:","<",$description);
if (strlen($from) > 17) {
$from = textBetween("When:","&",$description);
$startDate = date($dateFormat,strtotime(substr($from,0,17)));
$startTime = date($timeFormat,strtotime(textBetween(substr($from,0,17),"to",$description)));
$startMonthCal = date('n',strtotime(substr($from,0,17)));
$startDay = date('j',strtotime(substr($from,0,17)));
$startYear = date('Y',strtotime(substr($from,0,17)));
$endTime = substr($from, strpos($from,"to")+2);
$tempEndTime = $endTime;
You could probably just add a conditional that says something like this:
// Extract the 'when' information from the item summary, and ignore everything else
if (strpos($description, "When:")) {
$from = textBetween("First start:","<",$description);
}
else {
$from = textBetween("When:","<",$description);
}
if (strlen($from) > 17) {
$from = textBetween("When:","&",$description);
$startDate = date($dateFormat,strtotime(substr($from,0,17)));
$startTime = date($timeFormat,strtotime(textBetween(substr($from,0,17),"to",$description)));
$startMonthCal = date('n',strtotime(substr($from,0,17)));
$startDay = date('j',strtotime(substr($from,0,17)));
$startYear = date('Y',strtotime(substr($from,0,17)));
$endTime = substr($from, strpos($from,"to")+2);
$tempEndTime = $endTime;
That should get you started.