Shortcuts - Get Event - not working when specific date given

If I use the Get Event from the Calendar app and select "Today" from a specific calendar that has no events today, it correctly returns no events.

However instead of using "Today" I actually pass a given date (which I want to pass from user input, but for testing I set specifically to "today's" date) the next event on the given calendar regardless of which day is returned, which is not what I expect. If the specific date passed is "today" why does it act different then "Today" being selected.

The same result happens if I try "Tomorrow" and set the specific date to tomorrow.

It seems that there is a bug that if you use a "specific" date it always returns an event even if it is not on the specified date.

What am I missing?

Posted on Dec 17, 2023 5:45 PM

Reply
Question marked as Top-ranking reply

Posted on Dec 23, 2023 6:57 PM

Thanks for the suggestion. The one "quirk" that I have with that approach is that if I just give an "is exactly" for a given date for an "all day" event, it isn't found that way.

What I did get to work, which is a bit more "long" winded is I format two dates, a "StartDateTime" that has the time hard corded to "00:00:00" and a "EndDateTime" that has the time hard coded to "23:59:59" and then use "is between", that seems to work.

I haven't tried lots of examples, but so far it seems to work.

So for now this works as I really do want to use this "sub script" in a couple other Shortcuts...


Would still be easier if the "Get Event" worked consistently between a specific date/time and "today"... But for now, I have a working solution.


Again, thanks!

3 replies
Question marked as Top-ranking reply

Dec 23, 2023 6:57 PM in response to Recycleur

Thanks for the suggestion. The one "quirk" that I have with that approach is that if I just give an "is exactly" for a given date for an "all day" event, it isn't found that way.

What I did get to work, which is a bit more "long" winded is I format two dates, a "StartDateTime" that has the time hard corded to "00:00:00" and a "EndDateTime" that has the time hard coded to "23:59:59" and then use "is between", that seems to work.

I haven't tried lots of examples, but so far it seems to work.

So for now this works as I really do want to use this "sub script" in a couple other Shortcuts...


Would still be easier if the "Get Event" worked consistently between a specific date/time and "today"... But for now, I have a working solution.


Again, thanks!

Dec 23, 2023 8:31 PM in response to HeyAndy

I think the issue is that "today" creates a date that starts at midnight, whereas a specific date is by default set at noon if you don't set the time. Since an all-day event starts at midnight it's easily bypassed by a specific date.


Here's a cleaner variation of what you did. I learned with practice that it's not necessary to create specific variables as magic variables are usually sufficient.


In testing, I also found out that many Calendar actions are buggy (in Sonoma 14.1.2 at least). For example, Get Upcoming Events may ignore events that are not set to all-day. Some all-day events are also ignored sometimes. So it's not reliable at all.




This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Shortcuts - Get Event - not working when specific date given

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.