Merge pull request #2086 from dpalou/MOBILE-3068

Mobile 3068
main
Dani Palou 2019-08-29 11:34:47 +02:00 committed by GitHub
commit 6f3c8f55e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 6 deletions

View File

@ -39,7 +39,7 @@
<!-- Weeks. --> <!-- Weeks. -->
<ion-row *ngFor="let week of weeks" class="addon-calendar-week"> <ion-row *ngFor="let week of weeks" class="addon-calendar-week">
<ion-col *ngFor="let value of week.prepadding" class="dayblank addon-calendar-day"></ion-col> <!-- Empty slots (first week). --> <ion-col *ngFor="let value of week.prepadding" class="dayblank addon-calendar-day"></ion-col> <!-- Empty slots (first week). -->
<ion-col text-center *ngFor="let day of week.days" (click)="dayClicked(day.mday)" [ngClass]='{"hasevents": day.hasevents, "today": day.istoday, "weekend": day.isweekend, "duration_finish": day.haslastdayofevent}' class="addon-calendar-day" [class.addon-calendar-event-past-day]="isPastMonth || day.ispast"> <ion-col text-center *ngFor="let day of week.days" (click)="dayClicked(day.mday)" [ngClass]='{"hasevents": day.hasevents, "today": isCurrentMonth && day.istoday, "weekend": day.isweekend, "duration_finish": day.haslastdayofevent}' class="addon-calendar-day" [class.addon-calendar-event-past-day]="isPastMonth || day.ispast">
<p class="addon-calendar-day-number"><span>{{ day.mday }}</span></p> <p class="addon-calendar-day-number"><span>{{ day.mday }}</span></p>
<!-- In phone, display some dots to indicate the type of events. --> <!-- In phone, display some dots to indicate the type of events. -->

View File

@ -205,9 +205,12 @@ export class AddonCalendarCalendarComponent implements OnInit, OnChanges, OnDest
this.calculateIsCurrentMonth(); this.calculateIsCurrentMonth();
if (this.isCurrentMonth) { if (this.isCurrentMonth) {
const currentDay = new Date().getDate();
let isPast = true; let isPast = true;
this.weeks.forEach((week) => { this.weeks.forEach((week) => {
week.days.some((day) => { week.days.some((day) => {
day.istoday = day.mday == currentDay;
day.ispast = isPast && !day.istoday; day.ispast = isPast && !day.istoday;
isPast = day.ispast; isPast = day.ispast;

View File

@ -195,14 +195,14 @@ export class AddonModFeedbackIndexComponent extends CoreCourseModuleMainActivity
} }
return this.fetchFeedbackOverviewData(this.access); return this.fetchFeedbackOverviewData(this.access);
}).then(() => { }).finally(() => {
// All data obtained, now fill the context menu. // Now fill the context menu.
this.fillContextMenu(refresh); this.fillContextMenu(refresh);
// Check if there are responses stored in offline. // Check if there are responses stored in offline.
return this.feedbackOffline.hasFeedbackOfflineData(this.feedback.id); return this.feedbackOffline.hasFeedbackOfflineData(this.feedback.id).then((hasOffline) => {
}).then((hasOffline) => { this.hasOffline = hasOffline;
this.hasOffline = hasOffline; });
}); });
} }