How can i get the week number of month using javascript / jquery?
For ex.:
First Week: 5th July, 2010. / Week Number = First monday
I was just able to figure out a easier code for calculate the number of weeks for a given month of an year ..
y == year for example { 2012 } m == is a value from { 0 - 11 }
function weeks_Of_Month( y, m ) {
var first = new Date(y, m,1).getDay();
var last = 32 - new Date(y, m, 32).getDate();
// logic to calculate number of weeks for the current month
return Math.ceil( (first + last)/7 );
}