I want to add 30 minutes and then one hour to my variable which i already have my own date
var initialDate = '10:00';
So
if (some condition){
// i add 30 minutes ->10:30
}elseif(another condition){
// i add 1hour ->11:00
}
I tried this but doesn't work
var initialDate = '10:00';
var theAdd = new Date(initialDate);
var finalDate = theAdd.setMinutes(theAdd.getMinutes() + 30);
Date
class developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/… – FormicationfinalDate
i have NaN , That's why I asked the question I thought this is not the right method. – AricaparsInt
invar initialDate = parseInt('10:00');
but i have this1800010
and it's not good – Arica