#any-date-parser returns wrong date

15 messages · Page 1 of 1 (latest)

sleek tendon

i have done that wrong so many times and it always took me ages to debug, because i kept forgetting

getDay returns the day of the week

they have added the disclaimer to mdn now

past magnetBOT

mdn Date.prototype.getDay()
The getDay() method returns the day of the week for the specified date according to local time, where 0 represents Sunday. For the day of the month, see Date.prototype.getDate().

sand ivy

huh that's a bit silly

but what's up with the month then

sleek tendon

same thing as applies to getDay

it starts with 0

past magnetBOT

mdn Date.prototype.getMonth()
The getMonth() method returns the month in the specified date according to local time, as a zero-based value (where zero indicates the first month of the year).

sand ivy

oh yeah just saw

well bruh

sleek tendon

i would encourage you to use the MDN docs more, since the rewrite they are pretty nice and usually state these weird things about methods

sand ivy

yeah I usually do read them but for some reason just didnt with this thing

but well thanks a lot

sleek tendon

i keep doing it on days where the number of the weekday aligns with the day of the month as well, and then get weirded out because it breaks after manipulating some things firL
it is a really, really nasty one to figure out