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

		if(!(dateA instanceof Date)) {
			dateA = new Date(dateA);
		}

		if (!(dateB instanceof Date)) {
			dateB = new Date(dateB);
		}

		switch(this.options.subDomain) {
		case "x_min":
		case "min":
			return dateA.getFullYear() === dateB.getFullYear() &&
				dateA.getMonth() === dateB.getMonth() &&
				dateA.getDate() === dateB.getDate() &&
				dateA.getHours() === dateB.getHours() &&
				dateA.getMinutes() === dateB.getMinutes();
		case "x_hour":
		case "hour":
			return dateA.getFullYear() === dateB.getFullYear() &&
				dateA.getMonth() === dateB.getMonth() &&
				dateA.getDate() === dateB.getDate() &&
				dateA.getHours() === dateB.getHours();
		case "x_day":
		case "day":
			return dateA.getFullYear() === dateB.getFullYear() &&
				dateA.getMonth() === dateB.getMonth() &&
				dateA.getDate() === dateB.getDate();
		case "x_week":
		case "week":
			return dateA.getFullYear() === dateB.getFullYear() &&
				this.getWeekNumber(dateA) === this.getWeekNumber(dateB);
		case "x_month":
		case "month":
			return dateA.getFullYear() === dateB.getFullYear() &&
				dateA.getMonth() === dateB.getMonth();
		default:
			return false;
		}
	}
function(dateA, dateB) {
		"use strict";

		if(!(dateA instanceof Date)) {
			dateA = new Date(dateA);
		}

		if (!(dateB instanceof Date)) {
			dateB = new Date(dateB);
		}

		switch(this.options.subDomain) {
		case "x_min":
		case "min":
			return dateA.getFullYear() === dateB.getFullYear() &&
				dateA.getMonth() === dateB.getMonth() &&
				dateA.getDate() === dateB.getDate() &&
				dateA.getHours() === dateB.getHours() &&
				dateA.getMinutes() === dateB.getMinutes();
		case "x_hour":
		case "hour":
			return dateA.getFullYear() === dateB.getFullYear() &&
				dateA.getMonth() === dateB.getMonth() &&
				dateA.getDate() === dateB.getDate() &&
				dateA.getHours() === dateB.getHours();
		case "x_day":
		case "day":
			return dateA.getFullYear() === dateB.getFullYear() &&
				dateA.getMonth() === dateB.getMonth() &&
				dateA.getDate() === dateB.getDate();
		case "x_week":
		case "week":
			return dateA.getFullYear() === dateB.getFullYear() &&
				this.getWeekNumber(dateA) === this.getWeekNumber(dateB);
		case "x_month":
		case "month":
			return dateA.getFullYear() === dateB.getFullYear() &&
				dateA.getMonth() === dateB.getMonth();
		default:
			return false;
		}
	}
function ( dateA , dateB ) { "use strict" ; if ( ! ( dateA instanceof Date ) ) { dateA = new Date ( dateA ) ; } if ( ! ( dateB instanceof Date ) ) { dateB = new Date ( dateB ) ; } switch ( this . options . subDomain ) { case "x_min" : case "min" : return dateA . getFullYear ( ) === dateB . getFullYear ( ) && dateA . getMonth ( ) === dateB . getMonth ( ) && dateA . getDate ( ) === dateB . getDate ( ) && dateA . getHours ( ) === dateB . getHours ( ) && dateA . getMinutes ( ) === dateB . getMinutes ( ) ; case "x_hour" : case "hour" : return dateA . getFullYear ( ) === dateB . getFullYear ( ) && dateA . getMonth ( ) === dateB . getMonth ( ) && dateA . getDate ( ) === dateB . getDate ( ) && dateA . getHours ( ) === dateB . getHours ( ) ; case "x_day" : case "day" : return dateA . getFullYear ( ) === dateB . getFullYear ( ) && dateA . getMonth ( ) === dateB . getMonth ( ) && dateA . getDate ( ) === dateB . getDate ( ) ; case "x_week" : case "week" : return dateA . getFullYear ( ) === dateB . getFullYear ( ) && this . getWeekNumber ( dateA ) === this . getWeekNumber ( dateB ) ; case "x_month" : case "month" : return dateA . getFullYear ( ) === dateB . getFullYear ( ) && dateA . getMonth ( ) === dateB . getMonth ( ) ; default : return false ; } }
Return whether 2 dates are equals
This function is subdomain-aware,
and dates comparison are dependent of the subdomain

@param  Date dateA First date to compare
@param  Date dateB Secon date to compare
@return bool true if the 2 dates are equals
 /* jshint maxcomplexity: false
Return whether 2 dates are equals This function is subdomain - aware and dates comparison are dependent of the subdomain