javascript for array rotation -


trying understand how code below brings number between 0-6

var dayinmili = 86400000; var weekinmili = 604800000; //datetime() returns miliseconds since thurs, jan 1 1970, need account week starting monday not thursday. while (currenttime.getday() != 1){   currenttime.settime(currenttime.gettime() - dayinmili); } //we need find number of weeks since beginning of year can //  use determine schedule rotation var weeks = math.floor(currenttime.gettime() / weekinmili ); var startpoint = weeks % 7; 

the modulo operator in last line returns remainder after dividing seven. in case, result assigned startpoint going 0 - 6.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

php - How can I edit my code to echo the data of child's element where my search term was found in, in XMLReader? -