Last active
March 23, 2020 09:30
-
-
Save jelleroorda/b7c94d90584720c8214c914193270e50 to your computer and use it in GitHub Desktop.
Zapier - once every two weeks interval from certain date
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Then go and filter based on the "continue" key: