i'm not familiar javascript want create script pull every single day of week me. here working right now.
i added picture "get date" , make when hit "get date" button, go through script , assign dates cells above monday, tuesday, wednesday, etc. 8/8, 8/9, 8/10.
i think you'll have in 2 steps:
- find last monday (which 6 days in past)
- starting there, build list of 7 days
var date = new date(), daysofweek = []; // find last monday while(date.getday() != 1) { date.setdate(date.getdate() - 1); } // build array of dates for(var n = 0; n < 7; n++) { daysofweek.push((date.getmonth() + 1) + '/' + date.getdate()); date.setdate(date.getdate() + 1); } console.log(daysofweek);
Comments
Post a Comment