#2: Remove empty fields from generated ical
All checks were successful
Jenkins Production Deployment
All checks were successful
Jenkins Production Deployment
This commit is contained in:
parent
fc071096d8
commit
d85f9a992b
|
@ -37,11 +37,9 @@ const serializeIcalEvent = (icalevent: iCalEvent): string => {
|
|||
returnString += 'DTSTART;TZID=Europe/Berlin:' + icalevent.start;
|
||||
returnString += 'DTEND;TZID=Europe/Berlin:' + icalevent.end;
|
||||
returnString += 'SUMMARY:' + icalevent.summary;
|
||||
returnString += 'DESCRIPTION:' + icalevent.description;
|
||||
returnString += 'LOCATION:' + icalevent.location;
|
||||
if(!isNullOrBlank(icalevent.url)) {
|
||||
returnString += 'URL:' + icalevent.url;
|
||||
}
|
||||
if(!isNullOrBlank(icalevent.description)) returnString += 'DESCRIPTION:' + icalevent.description;
|
||||
if(!isNullOrBlank(icalevent.location)) returnString += 'LOCATION:' + icalevent.location;
|
||||
if(!isNullOrBlank(icalevent.url)) returnString += 'URL:' + icalevent.url;
|
||||
returnString += icalevent.footer;
|
||||
|
||||
return returnString;
|
||||
|
@ -84,6 +82,8 @@ const addEventToFile = (ical: iCalFile, event: Event) => {
|
|||
};
|
||||
|
||||
const createIcalEvent = (event: Event): iCalEvent => {
|
||||
let description = event.description ? event.description + '\n' : '';
|
||||
let location = event.location ? event.location + '\n' : '';
|
||||
let url = event.url ? event.url + '\n' : '';
|
||||
|
||||
return {
|
||||
|
@ -94,8 +94,8 @@ const createIcalEvent = (event: Event): iCalEvent => {
|
|||
start: formatDate(event.startDateTime) + '\n',
|
||||
end: formatDate(event.endDateTime) + '\n',
|
||||
summary: event.name + '\n',
|
||||
description: event.description + '\n',
|
||||
location: event.location + '\n',
|
||||
description: description,
|
||||
location: location,
|
||||
url: url,
|
||||
footer: 'END:VEVENT\n'
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user