mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-27 14:31:41 +08:00
@@ -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) => {
|
||||
|
Reference in New Issue
Block a user