OzzyCzech / icalparser

Simple ical parser for PHP
https://ozana.cz
BSD 3-Clause "New" or "Revised" License
59 stars 22 forks source link

Export single Event #52

Closed demlak closed 4 years ago

demlak commented 4 years ago

Hey.. since it is possible to grab parsed informations of a single event out of an ICS-File with multiple events: Maybe it is possible or easy to implement exporting single event as ICS file?

thx

OzzyCzech commented 4 years ago

do not know what do you mean

You can get list of events like this:

$cal = new IcalParser();
$results = $cal->parseFile('file.ics');

foreach ($cal->getSortedEvents() as $r) {
    echo sprintf('  <li>%s - %s</li>' . PHP_EOL, $r['DTSTART']->format('j.n.Y'), $r['SUMMARY']);
}
demlak commented 4 years ago

My fault, if i was not clear enough, sorry.

with your great parser, it is possible to parse a complete ICS file, regardles if there are more than one events inside. but we also need single-event as ICS File out of an multiple-event-ICS-file. Something like splitting the ICS file into ICS-Files per event.

the basic idea/thought is: after parsing a single event out of a multiple-event-ICS-file, maybe it is possible to generate a new ICS File of this single event?

OzzyCzech commented 4 years ago

You can parse one file by one, that´s best solution

    1. 2020 v 11:05, demlak notifications@github.com:

 My fault, if i was not clear enough, sorry.

with your great parser, it is possible to parse a complete ICS file, regardles if there are more than one events inside. but we also need single-event as ICS File out of an multiple-event-ICS-file. Something like splitting the ICS file into ICS-Files per event.

the basic idea/thought is: after parsing a single event out of a multiple-event-ICS-file, maybe it is possible to generate a new ICS File of this single event?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

demlak commented 4 years ago

i'm sorry.. still thats not what i was trying to explain.

Works: single ICS File with multiple events -> parsing each event by iterating through complete ICS file Needed: single event -> generating ICS file

so.. AFTER parsing multiple events, i want to generate from this output a NEW ICS-file for each event (each event in a seperated ICS file)

something like this.. maybe i will use this script.. https://gist.github.com/jakebellacera/635416

OzzyCzech commented 4 years ago

yes, icalparser it's just parser