src/cal-heatmap.js
function (d) {
		"use strict";

		if (typeof d === "number") {
			d = new Date(d);
		}

		var monthFirstWeekNumber = this.getWeekNumber(new Date(d.getFullYear(), d.getMonth()));
		return this.getWeekNumber(d) - monthFirstWeekNumber - 1;
	}
function (d) {
		"use strict";

		if (typeof d === "number") {
			d = new Date(d);
		}

		var monthFirstWeekNumber = this.getWeekNumber(new Date(d.getFullYear(), d.getMonth()));
		return this.getWeekNumber(d) - monthFirstWeekNumber - 1;
	}
function ( d ) { "use strict" ; if ( typeof d === "number" ) { d = new Date ( d ) ; } var monthFirstWeekNumber = this . getWeekNumber ( new Date ( d . getFullYear ( ) , d . getMonth ( ) ) ) ; return this . getWeekNumber ( d ) - monthFirstWeekNumber - 1 ; }
Return the week number, relative to its month

@param  int|Date d Date or timestamp in milliseconds
@return int Week number, relative to the month [0-5]
Return the week number relative to its month