From 6e78c1847b1151c6c852bb244df52e1d3aa8b8ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 22 Mar 2022 12:21:16 +0100 Subject: [PATCH] MOBILE-3814 calendar: Fix calendar past events opacity --- src/addons/calendar/calendar-common.scss | 6 ++++++ src/addons/calendar/components/calendar/calendar.ts | 4 +--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/addons/calendar/calendar-common.scss b/src/addons/calendar/calendar-common.scss index 3691d26f2..3746e7872 100644 --- a/src/addons/calendar/calendar-common.scss +++ b/src/addons/calendar/calendar-common.scss @@ -9,6 +9,12 @@ color: white; border-radius: 50%; padding: 0.7rem; + --margin-vertical: 12px; + --margin-end: 12px; + margin-top: var(--margin-vertical); + margin-bottom: var(--margin-vertical); + @include margin-horizontal(null, var(--margin-end)); + } @each $category, $value in $calendar-event-category-colors { diff --git a/src/addons/calendar/components/calendar/calendar.ts b/src/addons/calendar/components/calendar/calendar.ts index 64cd0807d..4f984d83c 100644 --- a/src/addons/calendar/components/calendar/calendar.ts +++ b/src/addons/calendar/components/calendar/calendar.ts @@ -496,7 +496,6 @@ class AddonCalendarMonthSlidesItemsManagerSource extends CoreSwipeSlidesDynamicI const weeks = result.weeks as AddonCalendarWeek[]; const currentDay = new Date().getDate(); const currentTime = CoreTimeUtils.timestamp(); - let isPast = true; const preloadedMonth: PreloadedMonth = { ...month, @@ -523,8 +522,7 @@ class AddonCalendarMonthSlidesItemsManagerSource extends CoreSwipeSlidesDynamicI if (preloadedMonth.isCurrentMonth) { day.istoday = day.mday == currentDay; - day.ispast = isPast && !day.istoday; - isPast = day.ispast; + day.ispast = preloadedMonth.isPastMonth || day.mday < currentDay; if (day.istoday) { day.eventsFormated?.forEach((event) => {