From 398df9d58fa4089102769aea775b1d36d0e48cf6 Mon Sep 17 00:00:00 2001 From: Fabrice Mouhartem Date: Thu, 19 Oct 2023 10:50:47 +0200 Subject: [PATCH] #1171: Calendar ICS import and export handle the `description` field --- www/calendar/export.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/www/calendar/export.js b/www/calendar/export.js index 694179a9f..5d851d560 100644 --- a/www/calendar/export.js +++ b/www/calendar/export.js @@ -97,7 +97,6 @@ define([ }; - var addEvent = function (arr, data, recId) { var uid = data.id; var dt = getDT(data); @@ -105,6 +104,10 @@ define([ var end = dt.end; var rrule = getRRule(data); + var escapeValue = function(str) { + return str.replace(/\n/g, ["\\n"]); + } + Array.prototype.push.apply(arr, [ 'BEGIN:VEVENT', 'DTSTAMP:'+getICSDate(+new Date()), @@ -115,6 +118,7 @@ define([ rrule, 'SUMMARY:'+ data.title, 'LOCATION:'+ data.location, + 'DESCRIPTION:' + escapeValue(data.description), ].filter(Boolean)); if (Array.isArray(data.reminders)) { @@ -355,6 +359,7 @@ define([ category: 'time', title: ev.getFirstPropertyValue('summary'), location: ev.getFirstPropertyValue('location'), + description: ev.getFirstPropertyValue('description'), isAllDay: isAllDay, start: start, end: end,