@technobuddha/library
Version:
A large library of useful functions
25 lines (24 loc) • 994 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.isSameMonth = void 0;
var isSameYear_1 = __importDefault(require("../isSameYear"));
/**
* Determine if two dates occur in the same month
*
* @param input1 The first date
* @param input2 The second date
* @param __namedParameters see {@link Options}
* @default UTC false
* @returns true, if the two dates occur in the same month
*/
function isSameMonth(input1, input2, _a) {
var _b = _a === void 0 ? {} : _a, _c = _b.UTC, UTC = _c === void 0 ? false : _c;
if (UTC)
return input1.getUTCMonth() === input2.getUTCMonth() && isSameYear_1.default(input1, input2, { UTC: UTC });
return input1.getMonth() === input2.getMonth() && isSameYear_1.default(input1, input2, { UTC: UTC });
}
exports.isSameMonth = isSameMonth;
exports.default = isSameMonth;