Skip to content

Commit e161e56

Browse files
authored
chore(*): Add dynamic year label (#3588)
1 parent 07740af commit e161e56

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

projects/app-lob/src/app/grid/grid-boston-marathon/grid.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="grid__wrapper">
22
<div class="sample__header">
33
<div class="switch-sample">
4-
<h5 class="switch-sample__title">Boston Marathon 2023</h5>
4+
<h5 class="switch-sample__title">Boston Marathon {{ currentYear }}</h5>
55
<igx-switch [(ngModel)]="live" [disabled]="isFinished" title="Start/Stop the marathon"> <span class="switch-sample__label">Live</span>
66
</igx-switch>
77
</div>

projects/app-lob/src/app/grid/grid-boston-marathon/grid.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
AfterViewInit
1010
} from '@angular/core';
1111
import { IgxGridComponent, IgxNumberSummaryOperand, IgxStringFilteringOperand, IgxSummaryResult, CellType, OverlaySettings, IgxOverlayService, AbsolutePosition, OverlayClosingEventArgs, IgxSwitchComponent, IgxInputGroupComponent, IgxInputDirective, IgxPaginatorComponent, IgxColumnComponent, IgxCellTemplateDirective, IgxAvatarComponent, IgxBadgeComponent, IgxCircularProgressBarComponent } from 'igniteui-angular';
12-
import { IgxGridCellComponent } from 'igniteui-angular/lib/grids/cell.component';
1312
import { Athlete, АthletesData, SpeedDescriptor } from '../../data/athletesData';
1413
import { FormsModule } from '@angular/forms';
1514
import { IgxPreventDocumentScrollDirective } from '../../../../../../src/app/directives/prevent-scroll.directive';
@@ -49,6 +48,7 @@ export class GridComponent implements OnInit, OnDestroy, AfterViewInit {
4948
private _timer: any;
5049
private windowWidth: any;
5150
private _overlayId: string;
51+
currentYear: number;
5252

5353
get live(): boolean {
5454
return this._live;
@@ -80,6 +80,7 @@ export class GridComponent implements OnInit, OnDestroy, AfterViewInit {
8080

8181
constructor(@Inject(IgxOverlayService) public overlayService: IgxOverlayService) {}
8282
public ngOnInit(): void {
83+
this.currentYear = new Date().getFullYear();
8384
this.localData = АthletesData.slice(0, 30).sort((a, b) => b.TrackProgress - a.TrackProgress);
8485
this.localData.forEach(rec => this.getSpeed(rec));
8586
this.windowWidth = window.innerWidth;

0 commit comments

Comments
 (0)