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:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user