Skip to content

Commit

Permalink
fix issue with start and end date equal sessions / grouping issues in…
Browse files Browse the repository at this point in the history
… agenda
  • Loading branch information
geckse committed Jul 15, 2019
1 parent a50c126 commit 731bf0c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
18 changes: 12 additions & 6 deletions src/components/session-list/session-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ <h4 class="speaker" *ngIf="session?.speakers && session?.speakers.length">– <n
<!-- <span class="session-title" [innerHTML]="session.title"></span> -->
<div class="agenda-stats">
<h5 class="session-time">
{{session.timeStart | date: 'HH:mm': 'UTC'}} &mdash;
{{session.timeStart | date: 'HH:mm': 'UTC'}} <ng-container *ngIf="session.timeStart != session.timeEnd">&mdash;
{{session.timeEnd | date: 'HH:mm': 'UTC'}}
</ng-container>
</h5>
<h5>{{session.location ? session.location : ''}}</h5>
<ion-icon class="bookmark" name="bookmark-outline" md="md-bookmark" *ngIf="session.isFavorite || globalProvider.conferenceOptions.favoriteInAgenda" [ngClass]="session.isFavorite ? 'bookmark-active' : 'bookmark-inactive'" (click)="toggleFavorite($event, session)"></ion-icon>
Expand All @@ -26,8 +27,9 @@ <h3 [innerHTML]="session.title"></h3>
<h4 class="speaker" *ngIf="session?.speakers && session?.speakers.length"><ng-container *ngFor="let speaker of session.speakers"><span>{{speaker.name}}</span></ng-container></h4>
<div class="agenda-stats">
<h5>
{{session.timeStart | date: 'HH:mm': 'UTC'}} &mdash;
{{session.timeStart | date: 'HH:mm': 'UTC'}} <ng-container *ngIf="session.timeStart != session.timeEnd">&mdash;
{{session.timeEnd | date: 'HH:mm': 'UTC'}}
</ng-container>
</h5>
<h5>{{session.location ? session.location : ''}}</h5>
<ion-icon class="bookmark" name="bookmark-outline" md="md-bookmark" *ngIf="session.isFavorite || globalProvider.conferenceOptions.favoriteInAgenda" [ngClass]="session.isFavorite ? 'bookmark-active' : 'bookmark-inactive'" (click)="toggleFavorite($event, session)"></ion-icon>
Expand Down Expand Up @@ -61,8 +63,9 @@ <h4 class="speaker" *ngIf="session?.speakers && session?.speakers.length">– <n
<!-- <span class="session-title" [innerHTML]="session.title"></span> -->
<div class="agenda-stats">
<h5 class="session-time">
{{session.timeStart | date: 'HH:mm': 'UTC'}} &mdash;
{{session.timeStart | date: 'HH:mm': 'UTC'}} <ng-container *ngIf="session.timeStart != session.timeEnd">&mdash;
{{session.timeEnd | date: 'HH:mm': 'UTC'}}
</ng-container>
</h5>
<h5>{{session.location ? session.location : ''}}</h5>
<ion-icon class="bookmark" name="bookmark-outline" md="md-bookmark" *ngIf="session.isFavorite || globalProvider.conferenceOptions.favoriteInAgenda" [ngClass]="session.isFavorite ? 'bookmark-active' : 'bookmark-inactive'" (click)="toggleFavorite($event, session)"></ion-icon>
Expand All @@ -77,8 +80,9 @@ <h3 [innerHTML]="session.title"></h3>
<h4 class="speaker" *ngIf="session?.speakers && session?.speakers.length"><ng-container *ngFor="let speaker of session.speakers"><span *ngIf="speakerById[speaker]?.name">{{speakerById[speaker].name}}</span></ng-container></h4>
<div class="agenda-stats">
<h5>
{{session.timeStart | date: 'HH:mm': 'UTC'}} &mdash;
{{session.timeStart | date: 'HH:mm': 'UTC'}} <ng-container *ngIf="session.timeStart != session.timeEnd">&mdash;
{{session.timeEnd | date: 'HH:mm': 'UTC'}}
</ng-container>
</h5>
<h5>{{session.location ? session.location : ''}}</h5>
<ion-icon class="bookmark" name="bookmark-outline" md="md-bookmark" *ngIf="session.isFavorite || globalProvider.conferenceOptions.favoriteInAgenda" [ngClass]="session.isFavorite ? 'bookmark-active' : 'bookmark-inactive'" (click)="toggleFavorite($event, session)"></ion-icon>
Expand Down Expand Up @@ -109,8 +113,9 @@ <h4 class="date-heading sub-head">{{ (sessionsOfDay[i] && sessionsOfDay[i][0].ti

<div class="agenda-stats">
<h5 class="session-time">
{{session.timeStart | date: 'HH:mm': 'UTC'}} &mdash;
{{session.timeStart | date: 'HH:mm': 'UTC'}} <ng-container *ngIf="session.timeStart != session.timeEnd">&mdash;
{{session.timeEnd | date: 'HH:mm': 'UTC'}}
</ng-container>
</h5>
</div>

Expand Down Expand Up @@ -190,8 +195,9 @@ <h3 [innerHTML]="session.title"></h3>
<h4 class="speaker" *ngIf="session?.speakers && session?.speakers.length"><ng-container *ngFor="let speaker of session.speakers"><span *ngIf="speakerById[speaker]?.name">{{speakerById[speaker].name}}</span></ng-container></h4>
<div class="agenda-stats">
<h5>
{{session.timeStart | date: 'HH:mm': 'UTC'}} &mdash;
{{session.timeStart | date: 'HH:mm': 'UTC'}} <ng-container *ngIf="session.timeStart != session.timeEnd">&mdash;
{{session.timeEnd | date: 'HH:mm': 'UTC'}}
</ng-container>
</h5>
<h5>{{session.location ? session.location : ''}}</h5>
<ion-icon class="bookmark" name="bookmark-outline" md="md-bookmark" *ngIf="session.isFavorite || globalProvider.conferenceOptions.favoriteInAgenda" [ngClass]="session.isFavorite ? 'bookmark-active' : 'bookmark-inactive'" (click)="toggleFavorite($event, session)"></ion-icon>
Expand Down
3 changes: 2 additions & 1 deletion src/components/session-list/session-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ export class SessionListComponent {
}

// group session by days
let d = new Date(session.timeStart);
let timeDiffMs = (new Date(session.timeStart).getTimezoneOffset()) * 60 * 1000;
let d = new Date(new Date(session.timeStart).getTime() + timeDiffMs);
let key = d.getFullYear() + "-" + (d.getMonth()+1) + "-" + d.getDate();
if(key != lastKeyDay){
dayIndex++;
Expand Down

0 comments on commit 731bf0c

Please sign in to comment.