From 392031951162b7acfd988c0013dc2edf00024799 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Thu, 29 Aug 2019 10:37:01 +0200 Subject: [PATCH 1/2] MOBILE-3068 feedback: Fix offline warning shown when it shouldn't --- src/addon/mod/feedback/components/index/index.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/addon/mod/feedback/components/index/index.ts b/src/addon/mod/feedback/components/index/index.ts index 18aa04c65..eefc27a7e 100644 --- a/src/addon/mod/feedback/components/index/index.ts +++ b/src/addon/mod/feedback/components/index/index.ts @@ -195,14 +195,14 @@ export class AddonModFeedbackIndexComponent extends CoreCourseModuleMainActivity } return this.fetchFeedbackOverviewData(this.access); - }).then(() => { - // All data obtained, now fill the context menu. + }).finally(() => { + // Now fill the context menu. this.fillContextMenu(refresh); // Check if there are responses stored in offline. - return this.feedbackOffline.hasFeedbackOfflineData(this.feedback.id); - }).then((hasOffline) => { - this.hasOffline = hasOffline; + return this.feedbackOffline.hasFeedbackOfflineData(this.feedback.id).then((hasOffline) => { + this.hasOffline = hasOffline; + }); }); } From 1700f8947d53006286d76fe40a4a954e4f339f8b Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Thu, 29 Aug 2019 11:20:43 +0200 Subject: [PATCH 2/2] MOBILE-3068 calendar: Calculate istoday in the app --- .../calendar/components/calendar/addon-calendar-calendar.html | 2 +- src/addon/calendar/components/calendar/calendar.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/addon/calendar/components/calendar/addon-calendar-calendar.html b/src/addon/calendar/components/calendar/addon-calendar-calendar.html index 030377251..093b97064 100644 --- a/src/addon/calendar/components/calendar/addon-calendar-calendar.html +++ b/src/addon/calendar/components/calendar/addon-calendar-calendar.html @@ -39,7 +39,7 @@ - +

{{ day.mday }}

diff --git a/src/addon/calendar/components/calendar/calendar.ts b/src/addon/calendar/components/calendar/calendar.ts index 985f284c8..7b088b76f 100644 --- a/src/addon/calendar/components/calendar/calendar.ts +++ b/src/addon/calendar/components/calendar/calendar.ts @@ -205,9 +205,12 @@ export class AddonCalendarCalendarComponent implements OnInit, OnChanges, OnDest this.calculateIsCurrentMonth(); if (this.isCurrentMonth) { + const currentDay = new Date().getDate(); let isPast = true; + this.weeks.forEach((week) => { week.days.some((day) => { + day.istoday = day.mday == currentDay; day.ispast = isPast && !day.istoday; isPast = day.ispast;