nexxtway/react-rainbow

View on GitHub
src/components/WeeklyCalendar/hooks/useYearRange.js

Summary

Maintainability
A
1 hr
Test Coverage
import { useMemo } from 'react';
import { getYearsRange } from '../../Calendar/helpers';

export default function useYearRange(minDate, maxDate, date) {
    return useMemo(
        () =>
            getYearsRange({
                minDate,
                maxDate,
                currentMonth: date.getMonth(),
            }),
        [minDate, maxDate, date],
    );
}