Check if tomorrow is holiday

Hi, I have a Google calendar in which I write my kid's holiday (Christmas, easter, etc...). It is set like this for example : "Christmas from December 19 to January 2" (with no specific time of day, of course).

I would like a macro that checks, everyday, if the day after is included in a holiday or if it's a school day ?
In other words : checks if a calendar is not empty. It works with events that have a starting time, but apparently not with event occuring during several days ?

Thank you!
 
Last edited:

RSF

Well-known member
Possibly the Event Starts and Event Ends triggers, configured to look for any events in your kids' calendar -- set to look a day in advance? See attached macro for a quick example. The macro populates a dictionary variable containing the events from that calendar. It adds them a day in advance, and deletes them a day in advance of when they end, so you can inspect the dictionary to see what tomorrow's holidays/school days are.
 

Attachments

  • All_day_holiday_events.macro
    8.9 KB · Views: 14

RSF

Well-known member
@MacroDroidDev added a nice new feature allowing one to delete a key from a dictionary, in the most recent release. A much simpler macro is attached, making use of that new feature...
 

Attachments

  • All_day_holiday_events_2.macro
    4.3 KB · Views: 11
Thank you. In fact what I noticed (and that was my problem) is that the calendar i want to check HAS TO BE visible in google calendar. If it's synchronized but not selected as "displayed", MD won't be able to check events.
 

RSF

Well-known member
Hmmm. Must be an Android version issue ... I tested this with a hidden calendar and it seemed to work. I did specify the (hidden) calendar in the MacroDroid action explicitly... ("Maintenance" in this case):
Screenshot_20221115-211951.png
 

FrameXX

Well-known member
You could make use on of my macros. This one checks holuday via internet API. Just replace the SMS action with whatever you want. If today variable is empty it means there are no holiday today. You can use this as a constraint. Also you will need to change the country variable if you are not from US.

I know this is not a perfect solution, but could help.

 
Top