(js) Preserve the time when changing the day
parent
293b93ec69
commit
2bad5c0da4
|
@ -178,11 +178,16 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.$watch('editor.component.end', function(newEndDate, oldEndDate) {
|
$scope.$watch('editor.component.end', function(newEndDate, oldEndDate) {
|
||||||
|
if (newEndDate.getDate() !== oldEndDate.getDate() ||
|
||||||
|
newEndDate.getMonth() !== oldEndDate.getMonth() ||
|
||||||
|
newEndDate.getFullYear() !== oldEndDate.getFullYear())
|
||||||
|
vm.component.end.addMinutes(oldEndDate.getHours() * 60 + oldEndDate.getMinutes());
|
||||||
|
|
||||||
if (newEndDate <= vm.component.start) {
|
if (newEndDate <= vm.component.start) {
|
||||||
vm.component.end = oldEndDate;
|
vm.component.end = oldEndDate;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
vm.component.delta = Math.floor((Math.abs(vm.component.end-vm.component.start)/1000)/60);
|
vm.component.delta = Math.floor((Math.abs(vm.component.end - vm.component.start)/1000)/60);
|
||||||
vm.component.freebusy = vm.component.updateFreeBusyCoverage();
|
vm.component.freebusy = vm.component.updateFreeBusyCoverage();
|
||||||
vm.attendeesEditor.days = getDays();
|
vm.attendeesEditor.days = getDays();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue