ragflow / web /src /utils /date.ts
zxsipola123456's picture
Upload 769 files
ab2ded1 verified
raw
history blame contribute delete
399 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');
}