import { Component, Input, OnInit, AfterViewInit, QueryList, ViewChildren, ViewChild } from '@angular/core';
import { NgbTimeStruct } from '@ng-bootstrap/ng-bootstrap';
+import { AuthService } from '@eg/core/auth.service';
import {ComboboxEntry} from '@eg/share/combobox/combobox.component';
import {DateSelectComponent} from '@eg/share/date-select/date-select.component';
import {DateRangeSelectComponent} from '@eg/share/daterange-select/daterange-select.component';
advancedCollapsed = true;
attributes: IdlObject[] = [];
multiday = false;
+ handleDateChange: ($event: Date) => void;
isBooked: (col: any, row: any) => string;
resourceAvailabilityIcon: (row: any) => GridRowFlairEntry;
@ViewChild('newDialog') newDialog: FmRecordEditorComponent;
constructor(
+ private auth: AuthService,
private format: FormatService,
private pcrud: PcrudService,
private store: ServerStoreService,
this.scheduleGrids.forEach((g) => g.reload());
};
+ this.handleDateChange = ($event: Date) => {
+ this.pcrud.retrieve('aouhoo', this.auth.user().ws_ou())
+ .subscribe(hours => {
+ const startArray = hours['dow_' + ($event.getDay() + 6) % 7 + '_open']().split(':');
+ const endArray = hours['dow_' + ($event.getDay() + 6) % 7 + '_close']().split(':');
+ this.startOfDay = {
+ hour: ('00' == startArray[0]) ? 9 : +startArray[0],
+ minute: +startArray[1],
+ second: 0};
+ this.endOfDay = {
+ hour: ('00' == endArray[0]) ? 17 : +endArray[0],
+ minute: +endArray[1],
+ second: 0};
+ this.scheduleGrids.forEach((g) => g.reload());
+ });
+ }
+
this.handleMultiDayReservation = () => {
this.multiday = true;
this.setGranularity();