The code inside of the IF Statement works outside of it and adds 15 Minutes as expected but doesn't change anything inside of the IF Statement
New to coding and have been researching for hours and can't get around this so any input would be great thanks
function calTime() {
var format = "HH:mm";
var hour = document.getElementById('hourinput').value;
var mins = document.getElementById('mininput').value;
var bt = moment().add(hour,'h').add(mins, 'm').format(format);
if (moment(bt, "HH:mm").isAfter('10:15', "HH:mm")){
bt = moment(bt, "HH:mm").add(15, 'm').format(format);
}
else {
}
document.getElementById("output").innerHTML = bt;
}
Aucun commentaire:
Enregistrer un commentaire