|
module.exports.generateDate = () => { |
|
let dateObj = new Date(); |
|
let month = dateObj.getUTCMonth() + 1; //months from 1-12 |
|
let day = dateObj.getUTCDate(); |
|
let year = dateObj.getUTCFullYear(); |
|
|
|
if (Number(day) < 10) { |
|
day = '0' + day; |
|
} |
|
if (Number(month) < 10) { |
|
month = '0' + month; |
|
} |
|
newdate = year + "-" + month + "-" + day; |
|
return newdate; |
|
} |
helperFunctions is a little too vague of a file name and could mean anything. If this were a folder possibly with files/modules of individual functions then it might be a little more specific.
Reviews-API/src/helperFunctions.js
Lines 1 to 15 in b7769c4
helperFunctions is a little too vague of a file name and could mean anything. If this were a folder possibly with files/modules of individual functions then it might be a little more specific.