@hebcal/icalendar
Advanced tools
Comparing version 4.16.0 to 4.17.0
@@ -1,2 +0,2 @@ | ||
/*! @hebcal/icalendar v4.16.0 */ | ||
/*! @hebcal/icalendar v4.17.0 */ | ||
'use strict'; | ||
@@ -11,3 +11,3 @@ | ||
const version="4.16.0"; | ||
const version="4.17.0"; | ||
@@ -143,15 +143,28 @@ const VTIMEZONE = {}; | ||
this.subj = subj; | ||
const isUserEvent = Boolean(mask & core.flags.USER_EVENT); | ||
this.category = ev.category || CATEGORY[restApi.getEventCategories(ev)[0]]; | ||
} | ||
/** | ||
* @return {string} | ||
*/ | ||
if (ev.alarm) { | ||
this.alarm = ev.alarm; | ||
getAlarm() { | ||
const ev = this.ev; | ||
const mask = ev.getFlags(); | ||
const evAlarm = ev.alarm; | ||
if (typeof evAlarm === 'string') { | ||
return 'TRIGGER:' + evAlarm; | ||
} else if (core.greg.isDate(evAlarm)) { | ||
evAlarm.setSeconds(0); | ||
return 'TRIGGER;VALUE=DATE-TIME:' + IcalEvent.makeDtstamp(evAlarm); | ||
} else if (mask & core.flags.OMER_COUNT) { | ||
this.alarm = '-P0DT3H30M0S'; // 8:30pm Omer alarm evening before | ||
} else if (isUserEvent) { | ||
this.alarm = '-P0DT12H0M0S'; // noon the day before | ||
} else if (timed && ev.getDesc().startsWith('Candle lighting')) { | ||
this.alarm = '-P0DT0H10M0S'; // ten minutes | ||
return 'TRIGGER:-P0DT3H30M0S'; // 8:30pm Omer alarm evening before | ||
} else if (mask & core.flags.USER_EVENT) { | ||
return 'TRIGGER:-P0DT12H0M0S'; // noon the day before | ||
} else if (this.timed && ev.getDesc().startsWith('Candle lighting')) { | ||
return 'TRIGGER:-P0DT0H10M0S'; | ||
} | ||
this.category = ev.category || CATEGORY[restApi.getEventCategories(ev)[0]]; | ||
return null; | ||
} | ||
@@ -211,4 +224,6 @@ /** | ||
if (this.alarm) { | ||
arr.push('BEGIN:VALARM', 'ACTION:DISPLAY', 'DESCRIPTION:This is an event reminder', `TRIGGER:${this.alarm}`, 'END:VALARM'); | ||
const trigger = this.getAlarm(); | ||
if (trigger) { | ||
arr.push('BEGIN:VALARM', 'ACTION:DISPLAY', 'DESCRIPTION:Event reminder', `${trigger}`, 'END:VALARM'); | ||
} | ||
@@ -215,0 +230,0 @@ |
{ | ||
"name": "@hebcal/icalendar", | ||
"version": "4.16.0", | ||
"version": "4.17.0", | ||
"author": "Michael J. Radwin (https://github.com/mjradwin)", | ||
@@ -27,3 +27,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@hebcal/core": "^3.35.0", | ||
"@hebcal/core": "^3.36.0", | ||
"@hebcal/rest-api": "^3.13.0", | ||
@@ -30,0 +30,0 @@ "murmurhash3": "^0.5.0" |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33717
888
Updated@hebcal/core@^3.36.0