Skip to content

Instantly share code, notes, and snippets.

@jelleroorda
Last active March 23, 2020 09:30
Show Gist options
  • Save jelleroorda/b7c94d90584720c8214c914193270e50 to your computer and use it in GitHub Desktop.
Save jelleroorda/b7c94d90584720c8214c914193270e50 to your computer and use it in GitHub Desktop.
Zapier - once every two weeks interval from certain date
// 2020, 2, 16 === march 16th, 2020
let startDate = new Date(2020, 2, 16);
let nowDate = new Date(inputData.year, parseInt(inputData.month) - 1, inputData.day)
let milisecondsPerDay = 24 * 60 * 60 * 1000;
// Check if it's in a 14 days interval from now.
if (Math.round((nowDate - startDate) / milisecondsPerDay) % 14 === 0) {
return { "continue": true }
}
return { "continue": false }
@jelleroorda
Copy link
Author

Set up in Zapier:

Screenshot 2020-03-23 at 10 02 20

@jelleroorda
Copy link
Author

Then go and filter based on the "continue" key:

Screenshot 2020-03-23 at 10 03 39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment