从无法访问的项目Fork
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
/** * Independent time operation tool to facilitate subsequent switch to dayjs */
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, format = DATE_TIME_FORMAT ): string { return moment(date).format(format);
}
export function formatToDate(date: moment.MomentInput = null, format = DATE_FORMAT): string { return moment(date).format(format);
} export const dateUtil = moment;