Refactor utils and organize routes/schema

This commit is contained in:
Johnathon Slightham
2021-05-19 20:08:04 -04:00
parent ac404a0ac5
commit cafb324ddb
15 changed files with 128 additions and 115 deletions

13
utils/date.js Normal file
View File

@@ -0,0 +1,13 @@
// dateToEpoch(date) change the time of the date object to epoch
function dateToEpoch(d) {
console.log(d);
if (d) {
// When comparing js dates, the timezone does not matter
// ex. May 17 EDT == May 17 GMT, May 17 EDT != May 18 GMT
return d.setHours(0, 0, 0, 0);
} else {
return null;
}
}
module.exports.dateToEpoch = dateToEpoch;