I'm trying to add some day on a date but actually i got a strange result...
I test with today as current day (28/02/2019), and try to add like 400 day and I'm in year 2096... I think tere is a problem
Take a look at my function :
const user = { LastReport: new Date(), Validite: "413" }
var temp = new Date(user.LastReport)
console.log("Current : " + temp);
user.DateValide = temp.setDate(temp.getDate() + user.Validite);
console.log("Day to add : " + user.Validite)
console.log("Result : " + new Date(user.DateValide))
and my result :
There is something i'm doing wrong ?