1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-09 10:50:24 +00:00

feat: optimize commonjs (#6906)

Co-authored-by: 杨国璇 <ygx@Hello-word.local>
This commit is contained in:
杨国璇
2024-10-21 11:29:17 +08:00
committed by GitHub
parent 21085997e3
commit 8200113b7f
142 changed files with 823 additions and 538 deletions

View File

@@ -1,6 +1,6 @@
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import moment from 'moment';
import dayjs from 'dayjs';
import { FormGroup, Label, Input, InputGroup, InputGroupAddon, InputGroupText, FormText } from 'reactstrap';
import { gettext } from '../utils/constants';
import { Utils } from '../utils/utils';
@@ -53,18 +53,18 @@ class SetLinkExpiration extends React.Component {
}
if (this.isExpireDaysNoLimit) {
return current.isBefore(moment(), 'day');
return current.isBefore(dayjs(), 'day');
}
const { minDays, maxDays } = this.props;
const startDay = moment().add(minDays, 'days');
const endDay = moment().add(maxDays, 'days');
const startDay = dayjs().add(minDays, 'days');
const endDay = dayjs().add(maxDays, 'days');
if (minDays !== 0 && maxDays !== 0) {
return current.isBefore(startDay, 'day') || current.isAfter(endDay, 'day');
} else if (minDays !== 0 && maxDays === 0) {
return current.isBefore(startDay, 'day');
} else if (minDays === 0 && maxDays !== 0) {
return current.isBefore(moment(), 'day') || current.isAfter(endDay, 'day');
return current.isBefore(dayjs(), 'day') || current.isAfter(endDay, 'day');
}
};