Search for calendar events by month

Hello, all.

Back in the Workflow days (also the pre-Magic-Variables days), I created a workflow to search for events within a certain month. What I need is to find and count all events that match a simple search term and fall within a specific month—usually the current month, but sometimes last month. I ended up using convoluted logic to identify the dates to search between:

Get the current date
Add 1 month
Get start of month
Subtract 1 day
Set variable monthEnd
Get start of month
Set variable monthStart

And continue from there for last month.

I don’t see a more economical and elegant way to do this in Shortcuts, but I’m sure there’s something I’m missing. Any ideas?

I use this Shortcut to get the current month, it’s just three steps. The trick is to use the current date variable inside of the date action - I format the current date as the month only.

I’m sure there’s a better way, but it does work!

1 Like

Brilliant, that’ll save some steps. And I’ll refactor to use magic variables, too.

Thanks, Rose!

1 Like