On property "TRIGGER" (relative time) in VALARM, toJSDate method is not present
When creating a VALARM in a VEVENT on Thunderbird, e.g.:
BEGIN:VCALENDAR
BEGIN:VEVENT
...
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:Mozilla Standardbeschreibung
TRIGGER:-PT15M
END:VALARM
END:VEVENT
END:VCALENDAR
and this is feed into ical.js, then the parsed result looks like this when getting it as a property with ical.js:
object1
<ref *1> {
wrappedJSObject: [Circular *1],
weeks: 0,
days: 0,
hours: 0,
minutes: 15,
seconds: 0,
isNegative: true
}
However, when feeding an absolute date, we get a different object as a result:
BEGIN:VCALENDAR
BEGIN:VEVENT
...
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:Mozilla Standardbeschreibung
TRIGGER;VALUE=DATE-TIME:20200729T124720Z
END:VALARM
END:VEVENT
END:VCALENDAR
object2
// DISCLAIMER: I didn't bother finding the exact object equating to the above date.
<ref *1> {
wrappedJSObject: [Circular *1],
_time: [Object: null prototype] {
year: 2020,
month: 7,
day: 29,
hour: 13,
minute: 8,
second: 56,
isDate: false
},
_cachedUnixTime: null,
_pendingNormalization: true,
timezone: 'Z',
zone: <ref *2> {
wrappedJSObject: [Circular *2],
expandedUntilYear: 0,
changes: [],
tzid: 'UTC'
}
}
In object1, calling object1.toJSDate() will throw toJSDate is not a function, whereas object2.toJSDate() works.
To me, that is unexpected, as I imagine that the absolute time can be inferred from e.g. DTSTART.
From https://tools.ietf.org/html/rfc5545#section-3.2.14
In an alarm set to trigger on the "START" of an event or to-do, the "DTSTART" property MUST be present in the associated event or to-do. In an alarm in a "VEVENT" calendar component set to trigger on the "END" of the event, either the "DTEND" property MUST be present, or the "DTSTART" and "DURATION" properties MUST both be present. In an alarm in a "VTODO" calendar component set to trigger on the "END" of the to-do, either the "DUE" property MUST be present, or the "DTSTART" and "DURATION" properties MUST both be present.
I realize this is 4 years ago so it might not be relevant, but if this is still an issue I'd suggest a more condensed test case. The wrapper to Thunderbird adds some complexity, so figuring out if this is an issue with ical.js or the wrapper would be helpful. If you're no longer looking at this feel free to close the issue.
It looks like we haven't heard back on this issue, therefore we are closing this issue. If this problem persists in the latest version of ical.js, please re-open this issue.