I am using jquery-week-calendar-master to customize as par my need. I need to show a dropdown of weeks in a particular month
like
1st week
2nd week
3rd week
and so far

and by default the current week selected, here is my code... but some wrong there

var currdate = options.date;
var firstDay = new Date(currdate).getDay();
var totalDays = new Date(currdate.getFullYear(), currdate.getMonth() + 1, 0).getDate();
var totWeeks = Math.ceil((firstDay + totalDays) / 7);
var weekNum = 0 | currdate.getDate() / 7;
var currentWeek = ( currdate.getDate() % 7 === 0 ) ? weekNum - 1 : weekNum;
alert(weekNum);
var weekOptions='';
for(var i=0; i<totWeeks; i++) {
var currentWeekIndex = currentWeek-1;
weekOptions += '<option value="'+i+'">&lt;'+month + ' - ' +self._getWeekName(i)+'&gt;</option>';

}
$('.selectWeekOfMonth').html(weekOptions);
$('.selectWeekOfMonth').val(currentWeekIndex);
//alert(currentWeekIndex);
$calendarContainer.find(".selectWeekOfMonth").change(function() {
self.goToWeek($(this).val(), currentWeekIndex);
return false;
});


Also another problem is if for any month, it starts midweek, the week shows half...
The calendar first day of week starts from Monday
For example Sep 2013, starts from Saturday and 1st week shows
only 1
then 2-8
9-15
16-22
23-29
and 30

so here the week shows 6 but total no of week is 5

Please help! Its urgent