Skip to content

Commit

Permalink
fix(Event): Add missing : for ORGANIZERs
Browse files Browse the repository at this point in the history
close #610
  • Loading branch information
sebbo2002 committed Sep 15, 2024
1 parent 89390f6 commit dca6352
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1816,9 +1816,12 @@ export default class ICalEvent {
if (this.data.organizer.email && this.data.organizer.mailto) {
g += ';EMAIL=' + escape(this.data.organizer.email, false);
}

g += ':';
if(this.data.organizer.email) {
g += ':mailto:' + escape(this.data.organizer.mailto || this.data.organizer.email, false);
g += 'mailto:' + escape(this.data.organizer.mailto || this.data.organizer.email, false);
}

g += '\r\n';
}

Expand Down
10 changes: 10 additions & 0 deletions test/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1432,6 +1432,16 @@ describe('ical-generator Event', function () {
sentBy: undefined
});
});

it('should include a : (PR #610)', function () {
const event = new ICalEvent({
start: moment(),
summary: 'Example Event',
organizer: { name: 'Some Guy' }
}, new ICalCalendar());

assert.ok(event.toString().includes('ORGANIZER;CN="Some Guy":'));
});
});

describe('createAttendee()', function () {
Expand Down

0 comments on commit dca6352

Please sign in to comment.