From 4f15c03f911d73fe41ca8451f0f444f1df2115ca Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Wed, 10 Apr 2024 21:27:22 +0530 Subject: [PATCH] fix: api token expiry time (#4165) --- web/components/api-token/modal/form.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/web/components/api-token/modal/form.tsx b/web/components/api-token/modal/form.tsx index b2b3f64dc..93a92c9ef 100644 --- a/web/components/api-token/modal/form.tsx +++ b/web/components/api-token/modal/form.tsx @@ -95,7 +95,7 @@ export const CreateApiTokenForm: React.FC = (props) => { else { const expiryDate = getExpiryDate(data.expired_at ?? ""); - if (expiryDate) payload.expired_at = renderFormattedPayloadDate(expiryDate); + if (expiryDate) payload.expired_at = renderFormattedPayloadDate(new Date(expiryDate)); } await onSubmit(payload).then(() => { @@ -170,8 +170,8 @@ export const CreateApiTokenForm: React.FC = (props) => { {value === "custom" ? "Custom date" : selectedOption - ? selectedOption.label - : "Set expiration date"} + ? selectedOption.label + : "Set expiration date"} } value={value} @@ -207,8 +207,8 @@ export const CreateApiTokenForm: React.FC = (props) => { ? `Expires ${renderFormattedDate(customDate)}` : null : watch("expired_at") - ? `Expires ${getExpiryDate(watch("expired_at") ?? "")}` - : null} + ? `Expires ${getExpiryDate(watch("expired_at") ?? "")}` + : null} )}