(js) Preserve the time when changing the day

pull/110/head
Francis Lachapelle 2015-10-29 16:17:37 -04:00
parent 293b93ec69
commit 2bad5c0da4
1 changed files with 6 additions and 1 deletions

View File

@ -178,6 +178,11 @@
});
$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) {
vm.component.end = oldEndDate;
}