2020-03-17 23:09:43 -04:00
|
|
|
import { __ } from '~/locale';
|
|
|
|
|
|
|
|
const INTERVALS = {
|
|
|
|
minute: 'minute',
|
|
|
|
hour: 'hour',
|
|
|
|
day: 'day',
|
|
|
|
};
|
|
|
|
|
2020-07-16 02:09:33 -04:00
|
|
|
export const FILE_SYMLINK_MODE = '120000';
|
|
|
|
|
2021-04-02 05:09:02 -04:00
|
|
|
export const SHORT_DATE_FORMAT = 'd mmm, yyyy';
|
|
|
|
|
2021-08-11 14:10:52 -04:00
|
|
|
export const ISO_SHORT_FORMAT = 'yyyy-mm-dd';
|
|
|
|
|
|
|
|
export const DATE_FORMATS = [SHORT_DATE_FORMAT, ISO_SHORT_FORMAT];
|
|
|
|
|
2020-03-17 23:09:43 -04:00
|
|
|
export const timeRanges = [
|
|
|
|
{
|
|
|
|
label: __('30 minutes'),
|
|
|
|
duration: { seconds: 60 * 30 },
|
|
|
|
name: 'thirtyMinutes',
|
|
|
|
interval: INTERVALS.minute,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: __('3 hours'),
|
|
|
|
duration: { seconds: 60 * 60 * 3 },
|
|
|
|
name: 'threeHours',
|
|
|
|
interval: INTERVALS.hour,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: __('8 hours'),
|
|
|
|
duration: { seconds: 60 * 60 * 8 },
|
|
|
|
name: 'eightHours',
|
|
|
|
default: true,
|
|
|
|
interval: INTERVALS.hour,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: __('1 day'),
|
|
|
|
duration: { seconds: 60 * 60 * 24 * 1 },
|
|
|
|
name: 'oneDay',
|
|
|
|
interval: INTERVALS.hour,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: __('3 days'),
|
|
|
|
duration: { seconds: 60 * 60 * 24 * 3 },
|
|
|
|
name: 'threeDays',
|
|
|
|
interval: INTERVALS.hour,
|
|
|
|
},
|
|
|
|
{
|
2020-08-05 02:09:36 -04:00
|
|
|
label: __('7 days'),
|
2020-03-17 23:09:43 -04:00
|
|
|
duration: { seconds: 60 * 60 * 24 * 7 * 1 },
|
|
|
|
name: 'oneWeek',
|
|
|
|
interval: INTERVALS.day,
|
|
|
|
},
|
|
|
|
{
|
2020-08-05 02:09:36 -04:00
|
|
|
label: __('30 days'),
|
2020-03-17 23:09:43 -04:00
|
|
|
duration: { seconds: 60 * 60 * 24 * 30 },
|
|
|
|
name: 'oneMonth',
|
|
|
|
interval: INTERVALS.day,
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
2020-12-23 13:10:19 -05:00
|
|
|
export const defaultTimeRange = timeRanges.find((tr) => tr.default);
|
|
|
|
export const getTimeWindow = (timeWindowName) =>
|
|
|
|
timeRanges.find((tr) => tr.name === timeWindowName);
|
2021-11-02 08:12:25 -04:00
|
|
|
|
|
|
|
export const AVATAR_SHAPE_OPTION_CIRCLE = 'circle';
|
|
|
|
export const AVATAR_SHAPE_OPTION_RECT = 'rect';
|