update icalparser to 1e68aae75dbac8f7c27df7b047c0404154d436c4 (supports php 8.2)
This commit is contained in:
parent
d48cf5c579
commit
05f1245d30
27 changed files with 1572 additions and 586 deletions
|
@ -7,26 +7,36 @@
|
|||
|
||||
<title>Ical Parser example</title>
|
||||
|
||||
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>Czech holidays</h1>
|
||||
|
||||
<ul>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-end">Date</th>
|
||||
<th>Summary</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
use om\IcalParser;
|
||||
|
||||
require_once __DIR__ . '/../vendor/autoload.php';
|
||||
$cal = new \om\IcalParser();
|
||||
$results = $cal->parseFile(
|
||||
'https://www.google.com/calendar/ical/cs.czech%23holiday%40group.v.calendar.google.com/public/basic.ics'
|
||||
);
|
||||
|
||||
foreach ($cal->getSortedEvents() as $r) {
|
||||
echo sprintf(' <li>%s - %s</li>' . PHP_EOL, $r['DTSTART']->format('j.n.Y'), $r['SUMMARY']);
|
||||
$cal = new IcalParser();
|
||||
$results = $cal->parseFile('https://www.google.com/calendar/ical/cs.czech%23holiday%40group.v.calendar.google.com/public/basic.ics');
|
||||
|
||||
foreach ($cal->getEvents()->sorted() as $event) {
|
||||
printf('<tr><th class="text-end">%s</th><td>%s</td></tr>', $event['DTSTART']->format('j.n.Y'), $event['SUMMARY']);
|
||||
}
|
||||
|
||||
?></ul>
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue