Leo,
It would be much easier if you could use a Date table in the backend for these kind of requirements.
Table would have all the attributes for a particualr date like year,month,week number, week start date,week end date,month start date,month end date and anyother attributes you need for a date.
If you have the table, you can just pull the distinct week start and end dates between the date range selected.
Regards
Sri Harsha