@eroyeroy/utils - v0.1.0
    Preparing search index...

    Function endOfMonth

    • Returns a new Date representing the last moment of the month (23:59:59.999, local time).

      Parameters

      • date: Date

        The input date.

      Returns Date

      endOfMonth(new Date("2024-06-15")) // => 2024-06-30T23:59:59.999
      endOfMonth(new Date("2024-02-01")) // => 2024-02-29T23:59:59.999 (leap year)