如何从一周的数字中获取javascript日期?

我如何从javascript(或jquery)中获取周数和年份的第一天的日期?

例如:2013年第30周

提前致谢 !

 var d = new Date(year, 0, 1); var days = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat']; d.setDate(d.getDate() + (week * 7)); console.log(days[d.getDay()]); 

试试这个

 function getDateByWeek( weeks, year ) { var date = new Date(year, 0, 1); var dayNum = d.getDay(); var requiredDate = --weeks * 7; // If 1 Jan is Friday to Sunday, go to next week if (((dayNum!=0) || dayNum > 4)) { requiredDate += 7; } // Add required number of days d.setDate(1 - d.getDay() + ++requiredDate ); return date; }