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

how to do a event reminder? #93

Open
liangminghaoAngus opened this issue Jun 18, 2024 · 4 comments
Open

how to do a event reminder? #93

liangminghaoAngus opened this issue Jun 18, 2024 · 4 comments
Assignees

Comments

@liangminghaoAngus
Copy link

well,is that a example to tell me how to do a simple event reminder?
i have not found a example about it...
such as a event start at 09:00,i want a reminder at 07:00
i do make a event for cal,but have not idea to make a reminder

@arran4
Copy link
Owner

arran4 commented Jun 18, 2024

Hi @liangminghaoAngus

This is just a serializer / deserializer. I do need to create some documentation for it.

So I created a calendar (using KOrganizer)

006fc755-dda4-41a6-b477-0b187a1ac447.zip

The part of interest is at the end:

BEGIN:VEVENT
DTSTAMP:20240618T233745Z
CREATED:20240618T233745Z
UID:006fc755-dda4-41a6-b477-0b187a1ac447
LAST-MODIFIED:20240618T233745Z
SUMMARY:test
LOCATION:test
DTSTART;TZID=Australia/Melbourne:20240619T100000
DTEND;TZID=Australia/Melbourne:20240619T101500
TRANSP:OPAQUE
BEGIN:VALARM
DESCRIPTION:
ACTION:DISPLAY
TRIGGER:-PT5M
X-KDE-KCALCORE-ENABLED:TRUE
END:VALARM
END:VEVENT

That's the whole event. We are interested in the VALARM part:

BEGIN:VALARM
DESCRIPTION:
ACTION:DISPLAY
TRIGGER:-PT5M
X-KDE-KCALCORE-ENABLED:TRUE
END:VALARM

So that's for this event:

image

It's nested. I haven't used the library in a while, but if you can't do that in it, that's a bug.

@arran4 arran4 self-assigned this Jun 18, 2024
@arran4
Copy link
Owner

arran4 commented Jun 18, 2024

I have some things on my plate but let me know how you go, I will attempt to follow up. If needed follow through with a fix.

@liangminghaoAngus
Copy link
Author

thx ,i found the way to use it.here is my code ,it works
and it is needed to create some documentation for it.

			reminder := ics.NewAlarm(uuidString)
			reminder.SetSummary(summary)
			reminder.SetDescription(description)
			reminder.SetAction(ics.ActionDisplay)
			reminder.SetTrigger("-PT2H")
			event.AddVAlarm(reminder)

@arran4
Copy link
Owner

arran4 commented Jun 19, 2024

Awesome. -- Keeping this open as a reminder regarding documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants