添加首页统计跳转页面
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { http } from './config';
|
||||
import Big from 'big.js';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
export const formatTime = (date: Date) => {
|
||||
const year = date.getFullYear();
|
||||
@@ -383,3 +384,8 @@ export const formatFileSize = (fileSize: any): string => {
|
||||
const size = file_size / 1024 ** index;
|
||||
return size.toFixed(0) + unitArr[index];
|
||||
};
|
||||
|
||||
export const getDay = (option?: { value: number; unit: 'day' | 'month' | 'year' }) => {
|
||||
const { value = 0, unit = 'day' } = option || {};
|
||||
return dayjs().subtract(value, unit).format('YYYY-MM-DD');
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user