these things

This commit is contained in:
Hri7566 2022-10-18 19:37:09 -04:00
parent be121478b3
commit eafca18a05
2 changed files with 6 additions and 0 deletions

3
color-tester.js Normal file
View File

@ -0,0 +1,3 @@
const ColorEncoder = require("./src/ColorEncoder");
console.log(ColorEncoder.getTimeColor(new Date("Dec 30 1970")).toHexa());

View File

@ -58,6 +58,9 @@ function getTimeColor(currentDate = new Date()) {
let differenceInTime = (currentDate - newYearsDay) + ((newYearsDay.getTimezoneOffset() - currentDate.getTimezoneOffset()) * 60 * 1000);
let oneDayInMS = 1000 * 60 * 60 * 24;
let dayOfYear = Math.ceil(differenceInTime / oneDayInMS);
dayOfYear %= 365;
console.log(dayOfYear);
// get hour
let hours = currentDate.getHours();