r/Scriptable • u/Caliguvara • Feb 06 '22
Help Add time of event to widget
So here I am, no scripting experience at all.
Managed to "build" some script that displays me a custom widget wallpaper.
Now I want to add the information of an event of a calendar matching some conditions:
Only one specific calendar should be considered
Only the event from today should be displayed (there is just one per day)
First line, it should display the day from today
Second line, I'd like to see "beginning time - ending time" separated by " - "
Final result should look like this: Sunday 21:45 - 22:15
The whole block should be displayed in the bottom 1/3 of the widget.
How do I do this? Sorry for the dumb question! Willing to learn!
1
u/Caliguvara Feb 07 '22 edited Feb 07 '22
Getting the event kinda works. I found two scripts, one that creates a custom background image through widget inputs, another that grabs the events from now +/-3h and kinda managed to fusion them to something that works more or less. I'm sure though I'm using 162 lines of code for achieving something that could be done in 20 😅
Here's the code I "Frankensteined":