How can i get the week number of month using javascript / jquery?
For ex.:
First Week: 5th July, 2010. / Week Number = First monday
I think this works. It returns the week of the month, starting at 0:
var d = new Date(); var date = d.getDate(); var day = d.getDay(); var weekOfMonth = Math.ceil((date - 1 - day) / 7);