@technobuddha/library
Version:
A large library of useful functions
21 lines (20 loc) • 690 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isSameYear = void 0;
/**
* Determine if two dates occur in the same year
*
* @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 year
*/
function isSameYear(input1, input2, _a) {
var _b = _a === void 0 ? {} : _a, _c = _b.UTC, UTC = _c === void 0 ? false : _c;
if (UTC)
return input1.getUTCFullYear() === input2.getUTCFullYear();
return input1.getFullYear() === input2.getFullYear();
}
exports.isSameYear = isSameYear;
exports.default = isSameYear;