mirror of
https://github.com/skidoodle/erettsegi-browser.git
synced 2025-02-15 05:39:15 +01:00
"minor" changes
This commit is contained in:
parent
f858856b5e
commit
ac0a47faf2
4 changed files with 111 additions and 131 deletions
14
src/utils/years.tsx
Normal file
14
src/utils/years.tsx
Normal 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)
|
||||
}, [])
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue