I’m a bit confused, the .getDate() return sunday – saturday from 0 – 6.
But when I console.log this code, I get 0, but it should be 1 b/c its a monday.
What am I doing wrong/how can I fix this.
Does this have to do with timezones? I am running this code on jsfiddle.
(I know there are similar questions but those seem to be ones where the user mixes up .getDay() and .getDate(), or they are using date like this: Date("2009","04","30")
for my case I need to use the single string parameter)
const date = new Date('2024-06-17').getDay(); // This is a Monday
console.log(date) // returns 0