Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On property "TRIGGER" (relative time) in VALARM, toJSDate method is not present #451

Closed
TimDaub opened this issue Aug 3, 2020 · 2 comments

Comments

@TimDaub
Copy link

TimDaub commented Aug 3, 2020

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.

@kewisch
Copy link
Owner

kewisch commented Apr 15, 2024

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.

@kewisch kewisch added the needinfo More information has been requested label Apr 15, 2024
Copy link

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.

@github-actions github-actions bot removed the needinfo More information has been requested label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants