mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-20 21:06:54 +08:00
### What problem does this PR solve? Feat: Add ChatCard #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
35 lines
621 B
TypeScript
35 lines
621 B
TypeScript
import dayjs from 'dayjs';
|
|
|
|
export function formatDate(date: any) {
|
|
if (!date) {
|
|
return '';
|
|
}
|
|
return dayjs(date).format('DD/MM/YYYY HH:mm:ss');
|
|
}
|
|
|
|
export function formatTime(date: any) {
|
|
if (!date) {
|
|
return '';
|
|
}
|
|
return dayjs(date).format('HH:mm:ss');
|
|
}
|
|
|
|
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 formatPureDate(date: any) {
|
|
if (!date) {
|
|
return '';
|
|
}
|
|
return dayjs(date).format('DD/MM/YYYY');
|
|
}
|