code: function weekNumber(d, firstWeekday) {
  		firstWeekday = firstWeekday || 'sunday';
  		// This works by shifting the weekday back by one day if we
  		// are treating Monday as the first day of the week.
  		var wday = d.getDay();
  		if (firstWeekday == 'monday') {
  			if (wday == 0) // Sunday
  				wday = 6;
  			else
  				wday--;
  		}
  		var firstDayOfYear = new Date(d.getFullYear(), 0, 1)
  			, yday = (d - firstDayOfYear) / 86400000
  			, weekNum = (yday + 7 - wday) / 7
  			;
  		//    return Math.floor(weekNum);
  		return weekNum | 0;
  	}
docs: firstWeekday: 'sunday' or 'monday', default is 'sunday'  Pilfered & ported from Ruby's strftime implementation.