How to get the 7 days in a week with a currentDate in javascript?
问题 (first, sorry for my bad english, i'm a beginner) I have a chart of percent by date. I would like to display every day of the current week in the x-axis. So, i tried to find how to get the seven days of the week. that's what i have : var curr = new Date; // get current date var first = curr.getDate() - curr.getDay();//to set first day on monday, not on sunday, first+1 : var firstday = (new Date(curr.setDate(first+1))).toString(); for(var i = 1;i<7;i++){ var next = first + i; var nextday =