Fix date limit

pull/2724/head
Jérémy Rialland 2023-06-19 15:21:57 +02:00 committed by Jérémy Rialland
parent 312633be68
commit 0114f412b3
1 changed files with 4 additions and 1 deletions

View File

@ -56,7 +56,10 @@ export default function DateField(props: DateFieldProps) {
required: true,
locale: language === 'fr' ? fr : enUS,
fromDate: type === 'date futur' ? new Date() : new Date('1800-01-01'),
toDate: type === 'date passé' ? new Date() : undefined,
toDate:
type === 'date passé'
? new Date()
: new Date(`${new Date().getFullYear() + 100}-01-01`),
})
const [inputValue, setInputValue] = useState<string>(