From d49656cb77a592c3037bca3122e0b388358df2fa Mon Sep 17 00:00:00 2001 From: mantikoros Date: Sun, 30 Jan 2022 23:20:27 -0600 Subject: [PATCH] create: market close includes time --- web/pages/create.tsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/web/pages/create.tsx b/web/pages/create.tsx index 4cd8b352..0dddd6f1 100644 --- a/web/pages/create.tsx +++ b/web/pages/create.tsx @@ -8,7 +8,6 @@ import { Spacer } from '../components/layout/spacer' import { useUser } from '../hooks/use-user' import { Contract, contractPath } from '../lib/firebase/contracts' import { createContract } from '../lib/firebase/api-call' -import { Row } from '../components/layout/row' import { AmountInput } from '../components/amount-input' import { MINIMUM_ANTE } from '../../common/antes' import { InfoTooltip } from '../components/info-tooltip' @@ -73,8 +72,8 @@ export function NewContract(props: { question: string; tag?: string }) { const [anteError, setAnteError] = useState() // By default, close the market a week from today - // const weekFromToday = dayjs().add(7, 'day').format('YYYY-MM-DD') - const [closeDate, setCloseDate] = useState(undefined) + const weekFromToday = dayjs().add(7, 'day').format('YYYY-MM-DDT23:59') + const [closeDate, setCloseDate] = useState(weekFromToday) const [isSubmitting, setIsSubmitting] = useState(false) @@ -157,15 +156,15 @@ export function NewContract(props: { question: string; tag?: string }) {
e.stopPropagation()} onChange={(e) => setCloseDate(e.target.value || '')} - min={new Date().toISOString().split('T')[0]} + min={Date.now()} disabled={isSubmitting} value={closeDate} />