-
No favorites yet
-
Browse the schedule and tap the on sessions you're interested in to build your personal schedule.
+
No favorites yet
+
Browse the schedule and tap the on sessions you're interested in to build your personal schedule.
+
No favorites on {{days[dayIndex]?.day}}
+
You have favorites on other days.
+
Show favorites on other days
Show all sessions
@@ -56,7 +59,7 @@
No favorites yet
- {{days[dayIndex].day}} - {{group.time}}
+ {{allDaysMode ? group.dayLabel : days[dayIndex]?.day}} - {{group.time}}
diff --git a/src/app/pages/schedule/schedule.ts b/src/app/pages/schedule/schedule.ts
index 19d95397..dc994129 100644
--- a/src/app/pages/schedule/schedule.ts
+++ b/src/app/pages/schedule/schedule.ts
@@ -36,6 +36,8 @@ export class SchedulePage implements OnInit, OnDestroy {
currentTime: Date;
todayIndex: string = null;
jumpBtnCollapsed: boolean = false;
+ hasFavoritesOnOtherDays: boolean = false;
+ allDaysMode: boolean = false;
private favoritesSubscription: Subscription;
constructor(
@@ -130,6 +132,7 @@ export class SchedulePage implements OnInit, OnDestroy {
updateSchedule() {
this.searchedAllDays = false;
+ this.allDaysMode = false;
// Close any open sliding items when the schedule updates
if (this.scheduleList) {
@@ -143,6 +146,12 @@ export class SchedulePage implements OnInit, OnDestroy {
this.confData.getTimeline(this.dayIndex, this.queryText, this.excludeTracks, this.segment).subscribe((data: any) => {
this.shownSessions = data.shownSessions;
this.groups = data.groups;
+
+ if (this.segment === 'favorites' && this.shownSessions === 0) {
+ this.checkFavoritesOnOtherDays();
+ } else {
+ this.hasFavoritesOnOtherDays = false;
+ }
});
this.changeDetectorRef.detectChanges();
@@ -178,6 +187,29 @@ export class SchedulePage implements OnInit, OnDestroy {
this.updateSchedule();
}
+ checkFavoritesOnOtherDays() {
+ this.hasFavoritesOnOtherDays = false;
+ for (let i = 0; i < this.days.length; i++) {
+ if (String(i) === this.dayIndex) continue;
+ this.confData.getTimeline(String(i), '', this.excludeTracks, 'favorites').subscribe((data: any) => {
+ if (data.shownSessions > 0) {
+ this.hasFavoritesOnOtherDays = true;
+ this.changeDetectorRef.detectChanges();
+ }
+ });
+ }
+ }
+
+ showAllFavorites() {
+ this.allDaysMode = true;
+ this.confData.getAllDaysTimeline(this.queryText, this.excludeTracks, 'favorites').subscribe((data: any) => {
+ this.shownSessions = data.shownSessions;
+ this.groups = data.groups;
+ this.hasFavoritesOnOtherDays = false;
+ this.changeDetectorRef.detectChanges();
+ });
+ }
+
searchAllDays() {
let found = false;
let checked = 0;
diff --git a/src/app/providers/conference-data.ts b/src/app/providers/conference-data.ts
index 49666fca..e509bd63 100644
--- a/src/app/providers/conference-data.ts
+++ b/src/app/providers/conference-data.ts
@@ -477,6 +477,47 @@ export class ConferenceData {
);
}
+ getAllDaysTimeline(
+ queryText = '',
+ excludeTracks: any[] = [],
+ segment = 'all'
+ ) {
+ return this.load().pipe(
+ map((data: any) => {
+ const schedule = data.schedule.sort(function(a, b){var x = a.date; var y = b.date; return ((x < y) ? -1 : ((x > y) ? 1 : 0));});
+ let shownSessions = 0;
+ const allGroups = [];
+
+ queryText = queryText.toLowerCase().replace(/,|\.|-/g, ' ');
+ const queryWords = queryText.split(' ').filter(w => !!w.trim().length);
+
+ schedule.forEach((day: any) => {
+ const dateObj = new Date(day.date + "T00:00:00.000-12:00");
+ const dayLabel = dateObj.toLocaleDateString('en-us', {timeZone: environment.timezone, weekday: 'short'});
+
+ day.groups.forEach((group: any) => {
+ group.hide = true;
+ group.dayLabel = dayLabel;
+
+ group.sessions.forEach((session: any) => {
+ this.filterSession(session, queryWords, excludeTracks, segment);
+ if (!session.hide) {
+ group.hide = false;
+ shownSessions++;
+ }
+ });
+
+ if (!group.hide) {
+ allGroups.push(group);
+ }
+ });
+ });
+
+ return { shownSessions, groups: allGroups };
+ })
+ );
+ }
+
getSessions(
queryText = '',
excludeTracks: any[] = [],