1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-06 05:25:41 -05:00

calendar: parse event links from description

This commit is contained in:
bbedward
2025-10-28 11:20:42 -04:00
parent cfa7d12dd3
commit 13a2813db9
4 changed files with 19 additions and 15 deletions

View File

@@ -223,6 +223,13 @@ Singleton {
let eventId = event.title + "_" + event['start-date']
+ "_" + (event['start-time'] || 'allday')
// Create event object template
let extractedUrl = ""
if (!event.url && event.description) {
let urlMatch = event.description.match(/https?:\/\/[^\s]+/)
if (urlMatch) {
extractedUrl = urlMatch[0]
}
}
let eventTemplate = {
"id": eventId,
"title": event.title || "Untitled Event",
@@ -230,7 +237,7 @@ Singleton {
"end": endTime,
"location": event.location || "",
"description": event.description || "",
"url": event.url || "",
"url": event.url || extractedUrl,
"calendar": "",
"color": "",
"allDay": event['all-day'] === "True",