29 lines
474 B
JavaScript
29 lines
474 B
JavaScript
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
|
|
};
|