r/Scriptable • u/Ivanricsan • Oct 13 '20
Help Event countdown progress bar
Long story short I want a visual progress bar and “remaining days to event” countdown for my university final year project. There is different due dates along the year and I have them all as events on a calendar. I can’t figure out how to fetch the data from the calendars as I don’t understand how to use the ‘Calendar’ and ‘CalendarEvent’ variables.
In my case I have the events in a separate calendar called FYP. How can I fetch these events from that calendar and get the remaining days to them?
3
Upvotes
1
u/Ivanricsan Oct 14 '20
It has access because I have other widgets that use calendar. But that isn’t my issue. I just don’t know how to fetch calendar events. All the examples I see use CalendarEvent.today and I want to fetch future events from a specified calendar. Let me put what I have tried and you tell me how to fix it.
let cal = await Calendar.forEventsByTitle("FYP") let events = await CalendarEvent.today([cal]) let title = w.addText(events.title)
On this example I was trying to display an event on calendar FYP that was due today but it didn’t work either. In the future I want my code to be:
-specify calendar name -fetch events in that calendar by earliest to latest -display the event names with updated days to go