File
Implements
Metadata
| selector |
cx-schedule |
| templateUrl |
./schedule.component.html |
Index
Properties
|
|
|
Methods
|
|
|
Inputs
|
|
|
|
weekDays
|
Type : WeekdayOpeningDay[]
|
|
|
import { Component, Input, OnInit } from '@angular/core';
import { PointOfService, WeekdayOpeningDay } from '@spartacus/core';
@Component({
selector: 'cx-schedule',
templateUrl: './schedule.component.html',
})
export class ScheduleComponent implements OnInit {
@Input()
location: PointOfService;
weekDays: WeekdayOpeningDay[];
constructor() {}
ngOnInit(): void {
if (this.location) {
this.weekDays = this.location.openingHours
?.weekDayOpeningList as WeekdayOpeningDay[];
}
}
}
<ng-content></ng-content>
<div class="container cx-store-hours" *ngIf="location.openingHours">
<div *ngFor="let day of weekDays" class="row">
<div class="cx-days col-4">{{ day.weekDay }}</div>
<div *ngIf="day.closed" class="cx-hours col-8 closed">
{{ 'storeFinder.closed' | cxTranslate }}
</div>
<div *ngIf="!day.closed" class="cx-hours col-8">
{{ day.openingTime?.formattedHour }} -
{{ day.closingTime?.formattedHour }}
</div>
</div>
</div>
Legend
Html element with directive