mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-20 04:39:00 +08:00
add front end code (#27)
This commit is contained in:
20
web/src/utils/date.ts
Normal file
20
web/src/utils/date.ts
Normal file
@ -0,0 +1,20 @@
|
||||
import moment from 'moment';
|
||||
|
||||
export function today() {
|
||||
return formatDate(moment());
|
||||
}
|
||||
|
||||
export function lastDay() {
|
||||
return formatDate(moment().subtract(1, 'days'));
|
||||
}
|
||||
|
||||
export function lastWeek() {
|
||||
return formatDate(moment().subtract(1, 'weeks'));
|
||||
}
|
||||
|
||||
export function formatDate(date) {
|
||||
if (!date) {
|
||||
return '';
|
||||
}
|
||||
return moment(date).format('YYYY-MM-DD');
|
||||
}
|
||||
Reference in New Issue
Block a user