Skip to content

Commit

Permalink
Alarm fix for Outlook (adamgibbons#210) and added missing types Alarm (
Browse files Browse the repository at this point in the history
  • Loading branch information
TiE23 authored Aug 27, 2022
1 parent 0043e24 commit 83ebbab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 3 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ export type classificationType = 'PUBLIC' | 'PRIVATE' | 'CONFIDENTIAL' | string;

export type Alarm = {
action?: ActionType;
description?: string;
summary?: string;
duration?: DurationObject;
trigger?: DurationObject; // @todo DateArray | DurationObject;
repeat?: number;
attachType?: string;
Expand Down
6 changes: 2 additions & 4 deletions src/pipeline/format.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,13 @@ export default function formatEvent(attributes = {}) {
icsFormat += foldLine(`ATTENDEE;${setContact(attendee)}`) + '\r\n'
})
}

icsFormat += recurrenceRule ? `RRULE:${recurrenceRule}\r\n` : ''
icsFormat += duration ? `DURATION:${formatDuration(duration)}\r\n` : ''
if (alarms) {
alarms.map(function (alarm) {
icsFormat += setAlarm(alarm)
})
}

icsFormat += recurrenceRule ? `RRULE:${recurrenceRule}\r\n` : ''
icsFormat += duration ? `DURATION:${formatDuration(duration)}\r\n` : ''
icsFormat += `END:VEVENT\r\n`
icsFormat += `END:VCALENDAR\r\n`

Expand Down

0 comments on commit 83ebbab

Please sign in to comment.