fix: canteen module layout

This commit is contained in:
Rainer Killinger
2021-06-01 13:06:34 +02:00
parent 4cf27b2c32
commit b89f5c4edd

View File

@@ -56,11 +56,9 @@ export class PlaceMensaDetailComponent implements AfterViewInit {
*/
startingDay: Moment;
constructor(private mensaService: PlaceMensaService) {
this.startingDay = moment();
this.startingDay.hour(0);
this.startingDay.minute(0);
this.startingDay.millisecond(0);
constructor(private readonly mensaService: PlaceMensaService) {
this.startingDay = moment()
.startOf('day');
}
/**
@@ -68,6 +66,13 @@ export class PlaceMensaDetailComponent implements AfterViewInit {
*/
ngAfterViewInit() {
this.dishes = this.mensaService.getAllDishes(this.item, this.displayRange);
this.dishes.then(result => (this.selectedDay = keys(result)[0]));
this.dishes.then((result) => {
for (const [key, value] of Object.entries(result)) {
if (value.length === 0) {
delete result[key];
}
}
this.selectedDay = keys(result)[0];
});
}
}