what i'am missing here? Javascript does not know or skips 31.10.2022? (wich happens to be yesterday xD)
Here is a link to try it: https://playcode.io/1000164
thanks for your time and effort!
var thisDate = new Date('2022', '10','31');
console.log(thisDate.getDate() + '-' + thisDate.getMonth());
Prints:
1-11
Expected:
31-10
you can also do:
var X1 = 1; //- 29
var X2 = 30
var thisDate = new Date('2022', '10','1');
thisDate.setDate(thisDate.getDate() + X);
console.log(thisDate.getDate() + '-' + thisDate.getMonth());
If you take X1 (anything below 30) it works as expected. But if you add 30 (wich sums up to 31) ... its first of November ... why?