How to setup automation every 2 weeks at specific hour

Hey guys,

I did see plenty of options to setup automation starter. However, I didn’t find out how to start my scenario every 2 weeks on Saturday at e.g. 8 PM.

Any advice?

Sure use the scheduler. But you make it skip a week you will need to do some modulo math. On a filter between the first and second module you can evaluate the current week number and see if it is off or even. Use date functions to extract current week number

const d = new Date();
const date = d.getDate();
const day = d.getDay();
const weekOfMonth = Math.ceil((date - 1 - day) / 7);

Other option, you run your scenario every 10080 minutes (number of minutes in a week) and you schedule to start your first run at 8 pm.

2 Likes

That’s clever and much easier to set up @loic.wiseflow

But don’t you mean every 20160 minutes to run it every other week?

1 Like