clean-jsdoc-theme TypeDoc APIv0.0.0

endOf

endOf(date: Date, unit: 'year' | 'month' | 'week' | 'day'): Date

Source: date.ts:324

Gets the end of a time period

Parameters

  • date (Date) — Input date
  • unit ("year" | "month" | "week" | "day") — Time unit

Returns

  • Date — End of the period

Example

CODE
endOf(new Date('2024-03-15'), 'day')
// 2024-03-15 23:59:59.999

endOf(new Date('2024-03-15'), 'month')
// 2024-03-31 23:59:59.999