I overestimated how much was in common between the two files. ics.php had its
own formatdate function, which it no longer does (thanks ben (/s)).
Reimplement ics.php's former formatdate function as ics_formatdate, and use
it instead of formatdate to format the dates in the ICS output.
Specifically, adds DTSTAMP properties to all of the objects (the calendar and
the events), terminates lines in CRLF, and splits the UID over 2 lines so the
validator is happy with me.
Here be dragons. I manually reverse-engineered an ICS file generated by a
program I wrote to figure out the syntax, and then I wrote some PHP to
generate a file to that spec.