function getWeekNumber(date) {
    date = date.clone();
    var dow = callDateGet(date, 'Day') || 7;
    date.addDays(4 - dow).reset();
    return 1 + floor(date.daysSince(date.clone().beginningOfYear()) / 7);
  }
function getWeekNumber(date) {
    date = date.clone();
    var dow = callDateGet(date, 'Day') || 7;
    date.addDays(4 - dow).reset();
    return 1 + floor(date.daysSince(date.clone().beginningOfYear()) / 7);
  }
function getWeekNumber ( date ) { date = date . clone ( ) ; var dow = callDateGet ( date , 'Day' ) || 7 ; date . addDays ( 4 - dow ) . reset ( ) ; return 1 + floor ( date . daysSince ( date . clone ( ) . beginningOfYear ( ) ) / 7 ) ; }
weeksSince won't work here as the result needs to be floored, not rounded.
weeksSince won t work here as the result needs to be floored not rounded .