add front end code (#27)

This commit is contained in:
KevinHuSh
2024-01-17 09:37:01 +08:00
committed by GitHub
parent 3859fce6bf
commit 6b8fc2ce1f
89 changed files with 21430 additions and 0 deletions

20
web/src/utils/date.ts Normal file
View 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');
}