Function getStartOfYear

  • Returns the start year date of the given date

    Parameters

    • Optionaldate: Date

      the date to inspect

    Returns Date | undefined

    the start year date of the given date

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