place-card.component.ts 1.29 KB
Newer Older
1
2
import { Component, OnInit, Input } from '@angular/core';
import { Place } from '../../../place';
mdsecurity's avatar
mdsecurity committed
3
4
5
6
7
8
@Component({
  selector: 'app-place-card',
  templateUrl: './place-card.component.html',
  styleUrls: ['./place-card.component.scss']
})
export class PlaceCardComponent implements OnInit {
9
10
  @Input() private place: Place;
  private status: string;
mdsecurity's avatar
mdsecurity committed
11
12
  private week: string[] = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"];

mdsecurity's avatar
mdsecurity committed
13
14
15
  constructor() { }

  ngOnInit() {
16
17
  //   let weekOpenTimes: number[][] = [];
  //   let weekCloseTimes: number[][] = [];
mdsecurity's avatar
mdsecurity committed
18

19
20
21
22
23
24
25
26
  //   for (let i = 0; i < 7; i++) {
  //     const hour1 = Math.floor(Math.random() * 24);
  //     const minute1 = Math.floor(Math.random() * 60);
  //     const hour2 = Math.floor(Math.random() * 24);
  //     const minute2 = Math.floor(Math.random() * 60);
  //     weekOpenTimes.push([hour1, minute1]);
  //     weekCloseTimes.push([hour2, minute2]);
  //   }
27

28
  //   this.status = 'OPEN';
29

30
31
32
33
34
35
  // }
  // //if t1 is bigger than t2 it returns true ;
  // private time_between = function (t1: number[], t2: number[]): boolean {
  //   // multiplying hours by 60 and adding minutes
  //   const t1_minutes = t1[0] * 60 + t1[1];
  //   const t2_minutes = t2[0] * 60 + t2[1];
mdsecurity's avatar
mdsecurity committed
36

37
38
39
40
41

  //   if (t1_minutes > t2_minutes) {
  //     return true;
  //   }
  //   return false;
mdsecurity's avatar
mdsecurity committed
42
43
  }
}