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

implementation for VALARM #298

Closed
jonnytest1 opened this issue Jan 24, 2024 · 2 comments
Closed

implementation for VALARM #298

jonnytest1 opened this issue Jan 24, 2024 · 2 comments

Comments

@jonnytest1
Copy link
Contributor

jonnytest1 commented Jan 24, 2024

https://www.kanzaki.com/docs/ical/valarm.html

according to this spec (which is also supported by google with private calender export)
alarms are added like this:

BEGIN:VEVENT
SUMMARY:event summary
...
BEGIN:VALARM
ACTION:DISPLAY
TRIGGER:-P0DT0H30M0S // 30 minutes prior
DESCRIPTION:This is an event reminder
END:VALARM
BEGIN:VALARM
ACTION:DISPLAY
TRIGGER:-P3D // 3 days prior
DESCRIPTION:This is an event reminder
END:VALARM
END:VEVENT

currently they are just parsed as uuids

ideally i think they should not only be parsed but also a utility method added to get the TRIGGER correctly parsed resulting in a Date object (similarly to rrule)

(
there is also non-relative alarms in the form of trigger: P0DT9H0M0S meaning it would be on the day of the event at 9 o clock
my solution for this part looked like this since i already made the relative implementation

const copy = new Date(start_or_rrule_date);
copy.setHours(0)
copy.setMinutes(0)
copy.setSeconds(0)

return  new Date(+copy + this.timeOffset)

)

@titanism
Copy link

PR would be awesome for this 🔥

@jonnytest1
Copy link
Contributor Author

#299

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

3 participants