@technobuddha/library
Version:
A large library of useful functions
21 lines (20 loc) • 757 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getEndOfYear = void 0;
var constants_1 = require("../constants");
/**
* Determine the last day of the year containing a date
*
* @param input The date
* @param __namedParameters see {@link Options}
* @default UTC false
* @returns Midnight of the last day of the year containing the input date
*/
function getEndOfYear(input, _a) {
var _b = _a === void 0 ? {} : _a, _c = _b.UTC, UTC = _c === void 0 ? false : _c;
if (UTC)
return new Date(Date.UTC(input.getUTCFullYear(), constants_1.month.december, 31));
return new Date(input.getFullYear(), constants_1.month.december, 31);
}
exports.getEndOfYear = getEndOfYear;
exports.default = getEndOfYear;