• Returns whether the given date is same year with the comparison date

    Parameters

    • Optionaldate: Date

      the date to check

    • Optionalcomparison: Date

      the date to compare

    Returns boolean

    whether the given date is same year with the comparison date

    isSameYear(new Date(2023, 1, 1), new Date(2023, 8, 30));    // true