You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.1 KiB

import {
Component,
ElementRef,
OnInit,
ViewChild
} from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { MatTableDataSource } from '@angular/material';
import { ScheduleService } from '../services/schedule.service';
import { ScheduleDataSource } from '../services/schedule.datasource';
@Component({
selector: 'schedule',
templateUrl: './schedule.component.html',
styleUrls: [ './schedule.component.css' ]
})
export class ScheduleComponent implements OnInit {
dataSource: ScheduleDataSource;
timeZone: string;
displayedColumns = [
'title',
'day',
'time'
];
constructor(private route: ActivatedRoute,
private scheduleService: ScheduleService) { }
ngOnInit() {
this.dataSource = new ScheduleDataSource(this.scheduleService);
this.dataSource.loadSchedule(false);
}
changeTimeZone(value) {
this.timeZone = value;
}
calcColor(value) {
let x = Math.min(Math.exp(value / 600000), 255);
return `rgb(255, ${x}, ${x})`;
}
}