date.js exports method
exports.getDate= function(){
const today = new Date(); //const containing new date
const options={ // const containing the object of what of the date is shown and in which data type
weekday:"long",
day:"numeric",
month:"long",
year:"numeric"
}
return today.toLocaleDateString("en-US",options); //converts the date to render the string representation of the date
};
exports.getDay=function(){
const today = new Date(); //const containing new date
const options={ // const containing the object of what of the date is shown and in which data type
weekday:"long",
}
return today.toLocaleDateString("en-US",options); //converts the date to render the string representation of the date
};
Comments
Post a Comment