feat(foundation): remove max expiration days check of API Token (#351)
This commit is contained in:
parent
c4e0e27702
commit
397912fccf
|
|
@ -17,17 +17,10 @@
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { I18n, type I18nKeysNoOptionsType } from '@coze-arch/i18n';
|
import { I18n, type I18nKeysNoOptionsType } from '@coze-arch/i18n';
|
||||||
|
|
||||||
const MAX_EXPIRATION_DAYS = 30;
|
|
||||||
// 1-30 days valid period
|
|
||||||
export const disabledDate = (date?: Date) => {
|
export const disabledDate = (date?: Date) => {
|
||||||
const today = dayjs().startOf('day'); // Start time of the day
|
const today = dayjs().startOf('day'); // Start time of the day
|
||||||
const thirtyDaysLater = today.add(MAX_EXPIRATION_DAYS, 'day'); // Date in 30 days
|
|
||||||
|
|
||||||
return (
|
return dayjs(date).isBefore(today, 'day') || dayjs(date).isSame(today, 'day');
|
||||||
dayjs(date).isBefore(today, 'day') ||
|
|
||||||
dayjs(date).isSame(today, 'day') ||
|
|
||||||
dayjs(date).isAfter(thirtyDaysLater, 'day')
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export enum ExpirationDate {
|
export enum ExpirationDate {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue