Function getStartOfMonth

  • Returns the start month date of the given date

    Parameters

    • Optionaldate: Date

      the date to inspect

    Returns Date | undefined

    the start month date of the given date

    getStartOfMonth(new Date(2023, 8, 30));    // Date(2023, 8, 1, 0, 0, 0)