"minor" changes

This commit is contained in:
skidoodle 2023-09-18 19:20:20 +02:00
parent f858856b5e
commit ac0a47faf2
4 changed files with 111 additions and 131 deletions

14
src/utils/years.tsx Normal file
View file

@ -0,0 +1,14 @@
import { useEffect } from 'react'
export function useAvailableYears(
setYears: React.Dispatch<React.SetStateAction<string[]>>
) {
useEffect(() => {
const currentYear = new Date().getFullYear()
const availableYears: string[] = []
for (let year = currentYear; year >= 2013; year--) {
availableYears.push(year.toString())
}
setYears(availableYears)
}, [])
}