mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-19 12:06:42 +08:00
### What problem does this PR solve? feat: render stats charts feat: create api token feat: delete api token feat: add ChatApiKeyModal feat: add RagLineChart Issue link: #345 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
21 lines
390 B
TypeScript
21 lines
390 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');
|
|
}
|