mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-07-31 12:12:10 +08:00

### What problem does this PR solve? fix: fix uploaded file time error #680 feat: support preview of word and excel #684 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
21 lines
399 B
TypeScript
21 lines
399 B
TypeScript
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');
|
|
}
|