Commit 7d78bf5b authored by mdsecurity's avatar mdsecurity

adding to place card ts

parent 4a593959
......@@ -3,11 +3,7 @@
<div class="place-info-block">
<i class="fa fa-star-o star-icon" aria-hidden="true"></i>
<div class="place-title">{{place.name}}</div>
<!--<div class="place-status-open">
<div class="status-text">OPEN</div>
<hr class="hr-vertical">
<div class="status-text">~13Hrs</div>
</div>-->
<div [ngClass]="(place.status === 'open')?'status-open' : 'status-closed'">
<div [ngClass]="(place.status==='open' )? 'text-open' : 'text-closed' ">{{status}}</div>
<hr class="hr-vertical">
......
......@@ -8,16 +8,36 @@ import { Place } from '../../../place';
export class PlaceCardComponent implements OnInit {
@Input() private place: Place;
private status: string;
private week: string[] = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"];
constructor() { }
ngOnInit() {
this.place = new Place('Burger King', [new Date()],
[new Date()], 'picture: string', 'open', 'The Johnson Center');
let t1 = new Date();
let t2 = new Date();
let weekStartTimes: Date[] = [];
let weekEndTimes: Date[] = [];
for (let i = 0; i < 7; i++) {
t1 = new Date();
t2 = new Date();
t1.setDate(5 + Math.random() * 6);
t1.setHours((Math.random() * 10) + 1);
t2.setHours((Math.random() * 10) + 13);
weekStartTimes.push(t1);
weekEndTimes.push(t2);
}
this.place = new Place('Burger King', weekStartTimes,
weekEndTimes, 'picture: string', 'open', 'The Johnson Center');
let todaysDate = this.place[new Date().getDay()];
console.log(todaysDate);
if (this.place.status === 'open') {
status = 'OPEN';
this.status = 'OPEN';
} else {
status = 'CLOSED';
this.status = 'CLOSED';
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment