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-04-19 23:31:49 +02:00
parent 7b711eabb3
commit 650ca16ff7
6 changed files with 23 additions and 17 deletions

View File

@@ -175,7 +175,13 @@
var date = newDate? newDate.getDayString() : angular.element($event.currentTarget).attr('date');
if (newDate)
_formatDate(newDate);
if (isToday) {
var d = new Date();
date = String(d.getFullYear()) + String((d.getMonth() + 1)).padStart(2, '0') + String((d.getDate())).padStart(2, '0');
}
$state.go('calendars.view', { day: date });
// Refresh calendar data if click on today
if (isToday) {
$rootScope.$emit('calendars:list');