UNPKG

@technobuddha/library

Version:
16 lines (15 loc) 520 B
import { month } from '../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 */ export function getEndOfYear(input, { UTC = false } = {}) { if (UTC) return new Date(Date.UTC(input.getUTCFullYear(), month.december, 31)); return new Date(input.getFullYear(), month.december, 31); } export default getEndOfYear;