fix(calendar): Fix calendar green dot stucks in original day when browser is opened for days and day changed

This commit is contained in:
smizrahi
2023-06-07 10:06:59 +02:00
parent fa5264e822
commit f22672cef8
3 changed files with 11 additions and 2 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -22,6 +22,7 @@
});
this.expandedAllDays = CalendarController.expandedAllDays;
this.views = stateEventsBlocks;
this.previousDate = null;
_registerHotkeys(hotkeys);
@@ -161,6 +162,14 @@
// Remove previous views
for (j = vm.views.length; j >= i; j--)
vm.views.splice(j, 1);
// Refresh view
var d = new Date();
var date = String(d.getFullYear()) + String((d.getMonth() + 1)).padStart(2, '0') + String((d.getDate())).padStart(2, '0');
if (vm.previousDate !== date) {
$state.go('calendars.view', { day: date });
vm.previousDate = date;
}
});
}