How can i get the week number of month using javascript / jquery?
For ex.:
First Week: 5th July, 2010. / Week Number = First monday
Please try below function.This one is considering week start date as Monday and week end date as Sunday.
getWeekNumber(date) {
var monthStartDate =new Date(new Date().getFullYear(), new
Date().getMonth(), 1);
monthStartDate = new Date(monthStartDate);
var day = startdate.getDay();
date = new Date(date);
var date = date.getDate();
return Math.ceil((date+ day-1)/ 7);
}