function getWeekNumber(thisDate) {
var dt = new Date(thisDate);
var thisDay = dt.getDate();
var newDate = dt;
newDate.setDate(1); // first day of month
var digit = newDate.getDay();
var Q = (thisDay + digit) / 7;
var R = (thisDay + digit) % 7;
if (R !== 0) return Math.ceil(Q);
else return Q;}
getWeekNumber(“07/31/2016”);
1
solved How to get week number from date input in javascript? [duplicate]