diff options
author | Raphael Kabo <raphaelkabo@hey.com> | 2023-10-06 16:25:29 +0100 |
---|---|---|
committer | Raphael Kabo <raphaelkabo@hey.com> | 2023-10-06 16:25:29 +0100 |
commit | 2996a4d05d0ea2f8446e2a2a0383979ceec748ae (patch) | |
tree | aeab360ac4c1aa14f50b638f9b799dad8df55ff8 /src/helpers.ts | |
parent | 115210bfd9a5ae7bb8b516ce0d2cf3d9042dead7 (diff) |
Run Prettier on all files
Diffstat (limited to 'src/helpers.ts')
-rw-r--r-- | src/helpers.ts | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/src/helpers.ts b/src/helpers.ts index 4528042..72bbd17 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -10,41 +10,41 @@ const siteName = config.general.site_name; // LOGGING export function addToLog(process: string, status: string, message: string) { - const logEntry = { - status, - process, - message, - timestamp: new Date(), - }; - new Log(logEntry).save().catch(() => { - console.log("Error saving log entry!"); - }); + const logEntry = { + status, + process, + message, + timestamp: new Date(), + }; + new Log(logEntry).save().catch(() => { + console.log("Error saving log entry!"); + }); } export function exportIcal(events: IEvent[], calendarName: string) { - if (!events || events.length < 1) return; + if (!events || events.length < 1) return; - // Create a new icalGenerator... generator - const cal = icalGenerator({ - name: calendarName || siteName, - }); - events.forEach((event) => { - // Add the event to the generator - cal.createEvent({ - start: moment.tz(event.start, event.timezone), - end: moment.tz(event.end, event.timezone), - timezone: event.timezone, - summary: event.name, - description: event.description, - organizer: { - name: event.hostName || "Anonymous", - email: event.creatorEmail || "anonymous@anonymous.com", - }, - location: event.location, - url: "https://" + domain + "/" + event.id, + // Create a new icalGenerator... generator + const cal = icalGenerator({ + name: calendarName || siteName, + }); + events.forEach((event) => { + // Add the event to the generator + cal.createEvent({ + start: moment.tz(event.start, event.timezone), + end: moment.tz(event.end, event.timezone), + timezone: event.timezone, + summary: event.name, + description: event.description, + organizer: { + name: event.hostName || "Anonymous", + email: event.creatorEmail || "anonymous@anonymous.com", + }, + location: event.location, + url: "https://" + domain + "/" + event.id, + }); }); - }); - // Stringify it! - const string = cal.toString(); - return string; + // Stringify it! + const string = cal.toString(); + return string; } |