ragflow / web /src /utils /date.ts
jinhai-2012's picture
Format file format from Windows/dos to Unix (#1949)
aeb6dbc
raw
history blame
379 Bytes
import dayjs from 'dayjs';
export function today() {
return formatDate(dayjs());
}
export function lastDay() {
return formatDate(dayjs().subtract(1, 'days'));
}
export function lastWeek() {
return formatDate(dayjs().subtract(1, 'weeks'));
}
export function formatDate(date: any) {
if (!date) {
return '';
}
return dayjs(date).format('DD/MM/YYYY HH:mm:ss');
}