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 { I18n, type I18nKeysNoOptionsType } from '@coze-arch/i18n';
|
||||
|
||||
const MAX_EXPIRATION_DAYS = 30;
|
||||
// 1-30 days valid period
|
||||
export const disabledDate = (date?: Date) => {
|
||||
const today = dayjs().startOf('day'); // Start time of the day
|
||||
const thirtyDaysLater = today.add(MAX_EXPIRATION_DAYS, 'day'); // Date in 30 days
|
||||
|
||||
return (
|
||||
dayjs(date).isBefore(today, 'day') ||
|
||||
dayjs(date).isSame(today, 'day') ||
|
||||
dayjs(date).isAfter(thirtyDaysLater, 'day')
|
||||
);
|
||||
return dayjs(date).isBefore(today, 'day') || dayjs(date).isSame(today, 'day');
|
||||
};
|
||||
|
||||
export enum ExpirationDate {
|
||||
|
|
|
|||
Loading…
Reference in New Issue