Skip to content

Commit

Permalink
Allow non-negative alarms
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin committed Oct 21, 2021
1 parent 09e8a4a commit 2c3ec4a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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.14.0",
"version": "4.14.1",
"author": "Michael J. Radwin (https://github.com/mjradwin)",
"keywords": [
"ical",
Expand Down
8 changes: 4 additions & 4 deletions src/icalendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ export class IcalEvent {
if (ev.alarm) {
this.alarm = ev.alarm;
} else if (mask & flags.OMER_COUNT) {
this.alarm = '0DT3H30M0S'; // 8:30pm Omer alarm evening before
this.alarm = '-P0DT3H30M0S'; // 8:30pm Omer alarm evening before
} else if (isUserEvent) {
this.alarm = '0DT12H0M0S'; // noon the day before
this.alarm = '-P0DT12H0M0S'; // noon the day before
} else if (timed && ev.getDesc().startsWith('Candle lighting')) {
this.alarm = '0DT0H10M0S'; // ten minutes
this.alarm = '-P0DT0H10M0S'; // ten minutes
}

this.category = ev.category || CATEGORY[getEventCategories(ev)[0]];
Expand Down Expand Up @@ -199,7 +199,7 @@ export class IcalEvent {
'BEGIN:VALARM',
'ACTION:DISPLAY',
'DESCRIPTION:This is an event reminder',
`TRIGGER:-P${this.alarm}`,
`TRIGGER:${this.alarm}`,
'END:VALARM',
);
}
Expand Down

0 comments on commit 2c3ec4a

Please sign in to comment.