Since months follow a 0 based index, the month should be calculated like so - ("0" + (date.getMonth()+1)).slice(-2) + "-" +
Since months follow a 0 based index, the month should be calculated like so - ("0" + (date.getMonth()+1)).slice(-2) + "-" +