Trying to understand how the code below always brings up a number between 0-6
var dayInMili = 86400000;
var weekInMili = 604800000;
//dateTime() returns miliseconds since Thurs, Jan 1 1970, need to account for week starting Monday not Thursday.
while (currentTime.getDay() != 1){
currentTime.setTime(currentTime.getTime() - dayInMili);
}
//we need to find the number of weeks since the beginning of the year so we can
// use that to determine schedule rotation
var weeks = Math.floor(currentTime.getTime() / weekInMili );
var startPoint = weeks % 7;