File

feature-libs/storefinder/components/schedule-component/schedule.component.ts

Implements

OnInit

Metadata

selector cx-schedule
templateUrl ./schedule.component.html

Index

Properties
Methods
Inputs

Constructor

constructor()

Inputs

location
Type : PointOfService

Methods

ngOnInit
ngOnInit()
Returns : void

Properties

location
Type : PointOfService
Decorators :
@Input()
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
Component
Html element with directive

result-matching ""

    No results matching ""