ragflow/web/src/utils/date.ts
balibabu 793e29f23a
fix: fix uploaded file time error #680 (#690)
### 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)
2024-05-09 11:30:15 +08:00

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');
}