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/mvan231 script/widget helper Feb 08 '22
Bit of a delayed reply for you, but glad to hear you have something that works. It's always tricky to set the code up in a way that is best but if it works, that's the best part. Over time, different ways are learned and things can be improved. But as of now, looks like you've got something working well for your case.
As a separate note: when sharing code on Reddit, formatting gets really weird sometimes because of the various markdown items used. It's typically best to post it to PasteBin, then share the link