Here\'s the given input from the user:
Year = 2011, Month = 3 (March), Week = 2
I want to get the days in week 2 of March 2011 in JavaScript.
e.g. Su
A little modification of the first answer that worked for me:
year = 2014;
week = 31;//week number is 31 for the example, could be 120.. it will just jump trough years
// get the date for the first day of the year
var firstDateOfYear = new Date(year,0,1);
// set the date to the number of days for the number of weeks
firstDateOfYear.setDate(firstDateOfYear.getDate()+(7 * (week-1)));
// get the number of the day in the week 0 (Sun) to 6 (Sat)
var counter = firstDateOfYear.getDay();
//make sunday the first day of the week
for(i=0;i