Resume/theme/helper.js

29 lines
474 B
JavaScript
Raw Normal View History

2023-05-03 16:44:33 -04:00
const validArray = (array) => array !== undefined && array.length > 0;
const formatdate = (date) => {
const monthNames = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
];
const monthIndex = date.getMonth();
const year = date.getFullYear();
return `${monthNames[monthIndex]} ${year}`;
}
module.exports = {
validArray,
formatdate
};