add timestamp
This commit is contained in:
parent
a3f46f2822
commit
6c6cee81bc
1 changed files with 12 additions and 5 deletions
17
index.php
17
index.php
|
@ -24,22 +24,29 @@ foreach ($icalLines as $line)
|
|||
$eventData['SUMMARY'] = str_replace("[UNHB] ", "", $data[1]);
|
||||
|
||||
if($data[0] == "DTSTAMP")
|
||||
$eventData['DTSTAMP'] = date('d M Y', strtotime(substr($data[1], 0, 8)));
|
||||
$eventData['DTSTAMP'] = strtotime(substr($data[1], 0, 8));
|
||||
|
||||
if($data[0] == "END" and $data[1] == "VEVENT")
|
||||
{
|
||||
array_unshift($events, $eventData);
|
||||
if($eventData['DTSTAMP'] > time())
|
||||
{
|
||||
array_unshift($events, $eventData);
|
||||
|
||||
if(count($events) == 4)
|
||||
break;
|
||||
}
|
||||
|
||||
$eventData = array();
|
||||
|
||||
|
||||
}
|
||||
|
||||
if(count($events) == 3)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
foreach ($events as $thisEvent)
|
||||
{
|
||||
echo "<h1>".$thisEvent['DTSTAMP']." => ".$thisEvent['SUMMARY']."</h1>";
|
||||
echo "<h1>".date('d M Y', $thisEvent['DTSTAMP'])." (".$thisEvent['DTSTAMP']." - ".time().") => ".$thisEvent['SUMMARY']."</h1>";
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
Loading…
Reference in a new issue