forked from github/plane
fix: api token expiry time (#4165)
This commit is contained in:
parent
43534dcaed
commit
4f15c03f91
@ -95,7 +95,7 @@ export const CreateApiTokenForm: React.FC<Props> = (props) => {
|
|||||||
else {
|
else {
|
||||||
const expiryDate = getExpiryDate(data.expired_at ?? "");
|
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(() => {
|
await onSubmit(payload).then(() => {
|
||||||
@ -170,8 +170,8 @@ export const CreateApiTokenForm: React.FC<Props> = (props) => {
|
|||||||
{value === "custom"
|
{value === "custom"
|
||||||
? "Custom date"
|
? "Custom date"
|
||||||
: selectedOption
|
: selectedOption
|
||||||
? selectedOption.label
|
? selectedOption.label
|
||||||
: "Set expiration date"}
|
: "Set expiration date"}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
value={value}
|
value={value}
|
||||||
@ -207,8 +207,8 @@ export const CreateApiTokenForm: React.FC<Props> = (props) => {
|
|||||||
? `Expires ${renderFormattedDate(customDate)}`
|
? `Expires ${renderFormattedDate(customDate)}`
|
||||||
: null
|
: null
|
||||||
: watch("expired_at")
|
: watch("expired_at")
|
||||||
? `Expires ${getExpiryDate(watch("expired_at") ?? "")}`
|
? `Expires ${getExpiryDate(watch("expired_at") ?? "")}`
|
||||||
: null}
|
: null}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user