File size: 497 Bytes
aeb6dbc f36a767 aeb6dbc |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
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'));
}
|