fix: set limit date context

master
Pierre-Louis Guhur 2 months ago
parent 53e950c83d
commit 061819cff0

@ -22,6 +22,15 @@ const LimitDate = () => {
});
};
const handleDate = (date) => {
setEndDate(date)
dispatch({
type: ElectionTypes.SET,
field: 'dateEnd',
value: date.toString(),
});
}
const desc = t('admin.limit-duration-desc');
const now = new Date();
const oneDay = 24 * 60 * 60 * 1000;
@ -52,7 +61,7 @@ const LimitDate = () => {
</div>
{hasDate ? (
<div className="mt-3">
<DatePicker date={endDate} setDate={setEndDate} />
<DatePicker date={endDate} setDate={handleDate} />
</div>
) : null}
</Container>

Loading…
Cancel
Save