refactor(table): refactor table #150 #148 #146 #130 #76

This commit is contained in:
vben
2020-12-31 21:24:47 +08:00
parent f3a70eed30
commit 9c2f3f30bb
35 changed files with 1113 additions and 468 deletions

View File

@@ -3,12 +3,15 @@ import moment from 'moment';
const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm';
const DATE_FORMAT = 'YYYY-MM-DD ';
export function formatToDateTime(date: moment.MomentInput = null): string {
return moment(date).format(DATE_TIME_FORMAT);
export function formatToDateTime(
date: moment.MomentInput = null,
format = DATE_TIME_FORMAT
): string {
return moment(date).format(format);
}
export function formatToDate(date: moment.MomentInput = null): string {
return moment(date).format(DATE_FORMAT);
export function formatToDate(date: moment.MomentInput = null, format = DATE_FORMAT): string {
return moment(date).format(format);
}
export const formatAgo = (str: string | number) => {