hswaw/site: wip new layout
Change-Id: I4da3a668429dee42c7292accb9e24b93703f1538
diff --git a/hswaw/site/calendar/load.go b/hswaw/site/calendar/load.go
index 5b36b9c..f9ae146 100644
--- a/hswaw/site/calendar/load.go
+++ b/hswaw/site/calendar/load.go
@@ -6,6 +6,7 @@
"io"
"net/http"
"sort"
+ "strings"
"time"
_ "time/tzdata"
@@ -57,6 +58,13 @@
}
summary := summaryProp.Value
+ var description string
+ descriptionProp := event.GetProperty(ics.ComponentPropertyDescription)
+ if descriptionProp != nil && descriptionProp.Value != "" {
+ // The ICS/iCal description has escaped newlines. Undo that.
+ description = strings.ReplaceAll(descriptionProp.Value, `\n`, "\n")
+ }
+
status := event.GetProperty(ics.ComponentPropertyStatus)
tentative := false
if status != nil {
@@ -87,11 +95,12 @@
}
u := &UpcomingEvent{
- UID: uid,
- Summary: summary,
- Start: start,
- End: end,
- Tentative: tentative,
+ UID: uid,
+ Summary: summary,
+ Description: description,
+ Start: start,
+ End: end,
+ Tentative: tentative,
}
if u.Elapsed(now) {
continue