From 1ab7a4162cfb37b440ba348d678235101b7ad8f6 Mon Sep 17 00:00:00 2001 From: mantikoros Date: Fri, 4 Feb 2022 17:38:40 -0600 Subject: [PATCH] fix market close date time --- web/pages/create.tsx | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/web/pages/create.tsx b/web/pages/create.tsx index bc747fc7..b1c44df7 100644 --- a/web/pages/create.tsx +++ b/web/pages/create.tsx @@ -77,7 +77,7 @@ export function NewContract(props: { question: string; tag?: string }) { const [isSubmitting, setIsSubmitting] = useState(false) - const closeTime = closeDate ? dateToMillis(closeDate) : undefined + const closeTime = closeDate ? dayjs(closeDate).valueOf() : undefined const balance = creator?.balance || 0 @@ -211,13 +211,3 @@ export function NewContract(props: { question: string; tag?: string }) { ) } - -// Given a date string like '2022-04-02', -// return the time just before midnight on that date (in the user's local time), as millis since epoch -function dateToMillis(date: string) { - return dayjs(date) - .set('hour', 23) - .set('minute', 59) - .set('second', 59) - .valueOf() -}