function asyncStuff(spinnerUp, dayIndex){
return new Promise(function(resolve, reject){
var e = window.event;
if (bytexApp.isSet(e)) {
e.stopPropagation();
e.preventDefault();
}
var spinnerUp = $(spinnerUp);
bytexApp.itineraryController.itineraryModel.days[dayIndex].startDateTime =
bytexApp.itineraryController.itineraryModel.days[dayIndex].startDateTime.plus({minutes: 10});
console.log(bytexApp.itineraryController.itineraryModel.days[dayIndex].startDateTime);
console.log(bytexApp.itineraryController.itineraryModel.days[dayIndex].startDateTime.minute);
// bytexApp.itineraryController.itineraryView.drawDay(this.itineraryModel, dayIndex);
bytexApp.itineraryController.itineraryView.dayViews[dayIndex].redrawTimes(bytexApp.itineraryController.itineraryModel.days[dayIndex]);
resolve(dayIndex);
});
}
asyncStuff(spinnerUp, dayIndex).then(function(dayIndex){
setTimeout(function(dayIndex) {
// bytexApp.itineraryController.recalculateDayActivityTimes(dayIndex);
}, 100);
});
Freitag, 21. Mai 2021
JavaScript Promise example
Abonnieren
Posts (Atom)