I have week number and year, need to find out date (friday) in that week and year.
function getFriday(week_num, year)
{
?
return friday_date_object;
i think if i should not use any date library i would:
assuming u use a christian week, where sunday is the frist day of the week. this is neccessary to find out if the first days in a year belong to the first week of the year or not.
create an array. months = new Array(31,28,31, ... ) if(year % 4 == 0) then february has 29 days.
days = num_week * 7;
then iterate over the month and decrease days by month[current]. if days gets negative increase days with the current month days again.
result: year-(current+1)-days
i hope this helps you. what u have to add on your own is the handling for january and the first days.