]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/eg2/src/app/staff/reporter/simple/sr-output-options.component.ts
LP1959048: manual ng lint fixes
[Evergreen.git] / Open-ILS / src / eg2 / src / app / staff / reporter / simple / sr-output-options.component.ts
1 import {Component, Input} from '@angular/core';
2 import {IdlService} from '@eg/core/idl.service';
3 import {SimpleReporterService, SRTemplate} from './simple-reporter.service';
4 import * as moment from 'moment-timezone';
5
6 @Component({
7   selector: 'eg-sr-output-options',
8   templateUrl: './sr-output-options.component.html'
9 })
10
11 export class SROutputOptionsComponent {
12
13     @Input() templ: SRTemplate;
14     @Input() readyToSchedule: () => boolean;
15     @Input() saveTemplate: (args: any) => void;
16
17     constructor(
18         private idl: IdlService,
19         private srSvc: SimpleReporterService
20     ) { }
21
22     defaultTime() {
23         // When changing to Later for the first time default minutes to the quarter hour
24         if (this.templ.runNow === 'later' && this.templ.runTime === null) {
25             const now = moment();
26             const nextQ = now.add(15 - (now.minutes() % 15), 'minutes');
27             this.templ.runTime = nextQ;
28         }
29     }
30
31 }