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

		var start = new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours());
		var stop = null;
		if (range instanceof Date) {
			stop = new Date(range.getFullYear(), range.getMonth(), range.getDate(), range.getHours());
		} else {
			stop = new Date(start);
			stop.setHours(stop.getHours() + range);
		}

		var domains = d3.time.hours(Math.min(start, stop), Math.max(start, stop));

		// Passing from DST to standard time
		// If there are 25 hours, let's compress the duplicate hours
		var i = 0;
		var total = domains.length;
		for(i = 0; i < total; i++) {
			if (i > 0 && (domains[i].getHours() === domains[i-1].getHours())) {
				this.DSTDomain.push(domains[i].getTime());
				domains.splice(i, 1);
				break;
			}
		}

		// d3.time.hours is returning more hours than needed when changing
		// from DST to standard time, because there is really 2 hours between
		// 1am and 2am!
		if (typeof range === "number" && domains.length > Math.abs(range)) {
			domains.splice(domains.length-1, 1);
		}

		return domains;
	}
function (d, range) {
		"use strict";

		var start = new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours());
		var stop = null;
		if (range instanceof Date) {
			stop = new Date(range.getFullYear(), range.getMonth(), range.getDate(), range.getHours());
		} else {
			stop = new Date(start);
			stop.setHours(stop.getHours() + range);
		}

		var domains = d3.time.hours(Math.min(start, stop), Math.max(start, stop));

		// Passing from DST to standard time
		// If there are 25 hours, let's compress the duplicate hours
		var i = 0;
		var total = domains.length;
		for(i = 0; i < total; i++) {
			if (i > 0 && (domains[i].getHours() === domains[i-1].getHours())) {
				this.DSTDomain.push(domains[i].getTime());
				domains.splice(i, 1);
				break;
			}
		}

		// d3.time.hours is returning more hours than needed when changing
		// from DST to standard time, because there is really 2 hours between
		// 1am and 2am!
		if (typeof range === "number" && domains.length > Math.abs(range)) {
			domains.splice(domains.length-1, 1);
		}

		return domains;
	}
function ( d , range ) { "use strict" ; var start = new Date ( d . getFullYear ( ) , d . getMonth ( ) , d . getDate ( ) , d . getHours ( ) ) ; var stop = null ; if ( range instanceof Date ) { stop = new Date ( range . getFullYear ( ) , range . getMonth ( ) , range . getDate ( ) , range . getHours ( ) ) ; } else { stop = new Date ( start ) ; stop . setHours ( stop . getHours ( ) + range ) ; } var domains = d3 . time . hours ( Math . min ( start , stop ) , Math . max ( start , stop ) ) ; // Passing from DST to standard time // If there are 25 hours, let's compress the duplicate hours var i = 0 ; var total = domains . length ; for ( i = 0 ; i < total ; i ++ ) { if ( i > 0 && ( domains [ i ] . getHours ( ) === domains [ i - 1 ] . getHours ( ) ) ) { this . DSTDomain . push ( domains [ i ] . getTime ( ) ) ; domains . splice ( i , 1 ) ; break ; } } // d3.time.hours is returning more hours than needed when changing // from DST to standard time, because there is really 2 hours between // 1am and 2am! if ( typeof range === "number" && domains . length > Math . abs ( range ) ) { domains . splice ( domains . length - 1 , 1 ) ; } return domains ; }
Return all the hours between 2 dates

@param  Date	d	A date
@param  int|date	range	Number of hours in the range, or a stop date
@return array	An array of hours
Return all the hours between 2 dates