Skip to content

Commit

Permalink
Allow disabling of alarm with explicit ev.alarm = false
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin committed Jan 10, 2023
1 parent 3bfd185 commit 607ff41
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hebcal/icalendar",
"version": "4.18.6",
"version": "4.19.0",
"author": "Michael J. Radwin (https://github.com/mjradwin)",
"keywords": [
"ical",
Expand Down
2 changes: 2 additions & 0 deletions src/icalendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ export class IcalEvent {
const evAlarm = ev.alarm;
if (typeof evAlarm === 'string') {
return 'TRIGGER:' + evAlarm;
} else if (typeof evAlarm === 'boolean' && !evAlarm) {
return null;
} else if (greg.isDate(evAlarm)) {
evAlarm.setSeconds(0);
return 'TRIGGER;VALUE=DATE-TIME:' + IcalEvent.makeDtstamp(evAlarm);
Expand Down

0 comments on commit 607ff41

Please sign in to comment.