From 061819cff0e620d8e7722c1ec8863300f095dc0a Mon Sep 17 00:00:00 2001 From: Pierre-Louis Guhur Date: Sun, 29 Jan 2023 19:05:45 +0100 Subject: [PATCH] fix: set limit date context --- components/admin/LimitDate.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/components/admin/LimitDate.tsx b/components/admin/LimitDate.tsx index d2e2580..9a1837b 100644 --- a/components/admin/LimitDate.tsx +++ b/components/admin/LimitDate.tsx @@ -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 = () => { {hasDate ? (
- +
) : null}