From 16f8dfeeb9b9a7da03997ecb38b1daa535e82097 Mon Sep 17 00:00:00 2001 From: abefernan <44572727+abefernan@users.noreply.github.com> Date: Mon, 5 Jun 2023 08:13:11 +0200 Subject: [PATCH] Fix month from now calculation --- .../CreateTxForm/MsgForm/MsgCreateVestingAccountForm.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/forms/CreateTxForm/MsgForm/MsgCreateVestingAccountForm.tsx b/components/forms/CreateTxForm/MsgForm/MsgCreateVestingAccountForm.tsx index 6626c65..424515d 100644 --- a/components/forms/CreateTxForm/MsgForm/MsgCreateVestingAccountForm.tsx +++ b/components/forms/CreateTxForm/MsgForm/MsgCreateVestingAccountForm.tsx @@ -16,9 +16,10 @@ import StackableContainer from "../../../layout/StackableContainer"; Matching the crazy datetime-local input format */ const getMinEndTime = (): string => { - const minDate = new Date(); + const minTimestamp = Date.now() + 1000 * 60 * 60 * 24 * 30; + const minDate = new Date(minTimestamp); - const minMonth = minDate.getMonth() + 1 + 1; // It's 0-indexed and we want next month + const minMonth = minDate.getMonth() + 1; // It's 0-indexed const minMonthStr = minMonth < 10 ? `0${minMonth}` : String(minMonth); const minDay = minDate.getDate();