From 70f4519873046b39fbb1eade9258c0ed261b5c32 Mon Sep 17 00:00:00 2001 From: Andrew Engelbrecht Date: Fri, 18 Mar 2022 18:30:44 -0400 Subject: [PATCH] add speaker names to calendar descriptions --- generate-ics | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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", -- 2.25.1