Nice! What's up with the + 1
, though? Well, getMonth()
returns the month as a number that starts with 0
. So does getDay()
with the weekday, by the way.
Whoa! As it turns out, getDay()
returns the weekday from 0
to 6
, not the day of the month.