how to find how much number of weeks are there in a month, i.e either a month is having 4 or 5 weeks , how it can be calculated from current date supplied.
Thanks
how to find how much number of weeks are there in a month, i.e either a month is having 4 or 5 weeks , how it can be calculated from current date supplied.
Thanks
For iPhone See: Number of weeks in month For web/Javascript, See: Get Weeks In Month Through Javascript. Algorithm is simple (from above page):
function weekCount(year, month_number) {
// month_number is in the range 1..12
var firstOfMonth = new Date(year, month_number-1, 1);
var lastOfMonth = new Date(year, month_number, 0);
var used = firstOfMonth.getDay() + lastOfMonth.getDate();
return Math.ceil( used / 7);
}