10-projects-10-hours
10-projects-10-hours copied to clipboard
Dynamic new year date
The string for the new year "1 Jan 2021" is not day dynamic which is not a good idea of coding in JS. I tried it this way: const currentYearEve = "31 Dec " + new Date().getFullYear();
I did that: let endDateInMeliSec = Date.UTC(new Date().getFullYear(), new Date().getMonth() + 2, 5, 22, 44);
Date.UTC is a method that we give it a UTC date and it return for us the number of meliseconds