revamp template

This commit is contained in:
fro1991
2025-02-01 16:44:51 +07:00
parent c432df568a
commit 276a289580
1212 changed files with 112762 additions and 0 deletions

36
src/utils/Date.ts Normal file
View File

@ -0,0 +1,36 @@
import moment from "moment";
const formatIsoDate = (isoDate: string) => {
const date = new Date(isoDate);
const monthNames = [
'Jan',
'Feb',
'Mar',
'Apr',
'May',
'Jun',
'Jul',
'Aug',
'Sep',
'Oct',
'Nov',
'Dec'
];
const day = date.getDate();
const month = monthNames[date.getMonth()];
const year = date.getFullYear();
return `${day} ${month}, ${year}`;
};
const get5LastYear = () => {
const last5Years = [];
for (let i = 0; i < 5; i++) {
last5Years.push(moment().subtract(i, 'years').format('YYYY'));
}
// console.log('last5Years :', last5Years);
return last5Years;
};
export { formatIsoDate, get5LastYear };