In Javascript, how to get the weekNumber in a month for a given date. week should start from monday.
I tried this
var firstDay = new Date(this.getFullYear(), this.getMonth(), 1).getDay();
return Math.ceil((this.getDate() + firstDay)/7);
but could not get the exact week number when the month does not starts with monday.
Thanks all