From: Andrew Engelbrecht Date: Fri, 18 Mar 2022 22:30:44 +0000 (-0400) Subject: add speaker names to calendar descriptions X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=70f4519873046b39fbb1eade9258c0ed261b5c32;p=lp-csv-to-ics.git add speaker names to calendar descriptions --- diff --git a/generate-ics b/generate-ics index 2b104f0..2f6ee0b 100755 --- a/generate-ics +++ b/generate-ics @@ -56,10 +56,13 @@ foreach ($csv as $linenum => $line) { throw new Exception("Invalid times when hackishly converting to UTC: " . $start_time . " - " . $end_time); } + // add speaker name to description if available, also use full description if available + $description = ($line[5] ? ($line[5] . " - ") : "") . ($line[7] ? $line[7] : $line[2]); + // generate the event $ics = new ICS(array( 'summary' => $line[2], - 'description' => $line[7] ? $line[7] : $line[2], + 'description' => $description, 'location' => $line[3] ? $line[3] : "Anywhere", 'dtstart' => $date . "T" . $start_time . "Z", 'dtend' => $date . "T" . $end_time . "Z",