I want to implement a schedule that repeats every 2 weeks (Perhaps I can use Modulos for this?). For example, Monday May 14 is Day 6, whereas Monday May 21 is Day 1. Then, Monday May 28 is back to Day 6. So far, what I've come with can only check if a Day is Monday. However, that Monday could either be Day 1 or Day 6. Is there a way I can distinguish these days? I've attached a code snippet below. Thanks.
*To clarify, I am disregarding the weekends, thus, the second Monday would be Day 6, not Day 8.
var time1 = new Date(2018,4,11);
var time2 = new Date(2018,4,21);
var time3 = new Date();
var diff = time2.getDate() - time1.getDate();
var dayNum = document.getElementById("dayNumber");
var day = time2.getDay();
var isWeekend = (day == 6) || (day == 0);
if((diff % 7 === 3) && day === 1){
document.getElementById("dayNumber").innerHTML="Today is Day 6";
}
//if day divided by 7 leaves a remainder of 3, and it's a monday, that day is either day 1 or day 6
<p id = "dayNumber"></p>