mirror of
https://github.com/datahub-project/datahub.git
synced 2025-10-28 17:33:04 +00:00
Use moment for max selectable date for acl access
This commit is contained in:
parent
25cc61debe
commit
e45146e755
@ -15,12 +15,6 @@ import { IAppConfig } from 'wherehows-web/typings/api/configurator/configurator'
|
||||
import { getAvatarProps } from 'wherehows-web/constants/avatars/avatars';
|
||||
import moment from 'moment';
|
||||
|
||||
/**
|
||||
* Returns the number of days in milliseconds, default is 1 day
|
||||
* @param {number} [day=1] the number of days to scale
|
||||
*/
|
||||
const millisecondDays = (day = 1) => day * 24 * 60 * 60 * 1000;
|
||||
|
||||
/**
|
||||
* Date object with the minimum selectable date for acl request expiration,
|
||||
* at least 1 day from now
|
||||
@ -37,7 +31,11 @@ const minSelectableExpirationDate = new Date(
|
||||
* up to 7 days from now
|
||||
* @type {Date}
|
||||
*/
|
||||
const maxSelectableExpirationDate = new Date(Date.now() + millisecondDays(7));
|
||||
const maxSelectableExpirationDate = new Date(
|
||||
moment()
|
||||
.add(7, 'days')
|
||||
.valueOf()
|
||||
);
|
||||
|
||||
export default class DatasetAclAccess extends Component {
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user