Fixed incorrect reference to getDay. Should have been getDate() because the former gets the day of the week, and the latter gets the day of the month. Confusing Date implementation in javascript!