mirror of
https://github.com/skidoodle/erettsegi-browser.git
synced 2026-04-28 13:37:35 +02:00
"minor" changes
This commit is contained in:
@@ -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)
|
||||
}, [])
|
||||
}
|
||||
Reference in New Issue
Block a user