Why is the month number returned by the .getMonth() method of Date off by one?
I am using this in my jade template:
span.date
- function convertDate(dateString) {var date = new Date(dateString);return date.getDate()+"."+date.getMonth()+"."+date.getFullYear();}
| #{convertDate(tile.date)}
while iterating over tiles.
For the input "2016-07-14" the return is "14.6.2016", for "2016-08-09" -> "9.7.2016" etc.
Why does a month get lost?