Download ragflow-main/web/src/utils/date.ts from pandaall/ragflow: direct link, hf CLI and curl.
- Browser
- Download file 621 Bytes
-
https://huggingface.co/datasets/pandaall/ragflow/resolve/main/ragflow-main/web/src/utils/date.ts
- Command line
-
hf download hf://datasets/pandaall/ragflow/ragflow-main/web/src/utils/date.ts
-
curl -L -o date.ts https://huggingface.co/datasets/pandaall/ragflow/resolve/main/ragflow-main/web/src/utils/date.ts
621 Bytes
| 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'); | |
| } | |