Returns a new Date representing the last moment of the month (23:59:59.999, local time).
Date
The input date.
endOfMonth(new Date("2024-06-15")) // => 2024-06-30T23:59:59.999endOfMonth(new Date("2024-02-01")) // => 2024-02-29T23:59:59.999 (leap year) Copy
endOfMonth(new Date("2024-06-15")) // => 2024-06-30T23:59:59.999endOfMonth(new Date("2024-02-01")) // => 2024-02-29T23:59:59.999 (leap year)
Returns a new
Daterepresenting the last moment of the month (23:59:59.999, local time).