Datepickers using max date with business date
This commit is contained in:
committed by
Arnold Gálovics
parent
753791a078
commit
a4b266080b
+7
-2
@@ -1,5 +1,5 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnChanges, Input, Output, EventEmitter } from '@angular/core';
|
||||
import { Component, OnChanges, Input, Output, EventEmitter, OnInit } from '@angular/core';
|
||||
import { Validators, FormGroup, FormControl } from '@angular/forms';
|
||||
|
||||
/** Rxjs Imports */
|
||||
@@ -22,7 +22,7 @@ import { Dates } from 'app/core/utils/dates';
|
||||
templateUrl: './edit-business-rule-parameters.component.html',
|
||||
styleUrls: ['./edit-business-rule-parameters.component.scss']
|
||||
})
|
||||
export class EditBusinessRuleParametersComponent implements OnChanges {
|
||||
export class EditBusinessRuleParametersComponent implements OnInit, OnChanges {
|
||||
|
||||
/** Run Report Parameters Data */
|
||||
@Input() paramData: any;
|
||||
@@ -44,11 +44,16 @@ export class EditBusinessRuleParametersComponent implements OnChanges {
|
||||
|
||||
/**
|
||||
* @param {ReportsService} reportsService Reports Service
|
||||
* @param {SettingsService} settingsService Settings Service.
|
||||
*/
|
||||
constructor(private reportsService: ReportsService,
|
||||
private settingsService: SettingsService,
|
||||
private dateUtils: Dates) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
this.maxDate = this.settingsService.businessDate;
|
||||
}
|
||||
|
||||
ngOnChanges() {
|
||||
if (this.paramData) {
|
||||
this.ReportForm = new FormGroup({});
|
||||
|
||||
+5
-1
@@ -7,6 +7,7 @@ import { ReportsService } from 'app/reports/reports.service';
|
||||
|
||||
/** Custom Models */
|
||||
import { ReportParameter } from 'app/reports/common-models/report-parameter.model';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
|
||||
/**
|
||||
* Edit SMS Campaign step.
|
||||
@@ -46,9 +47,11 @@ export class EditSmsCampaignStepComponent implements OnInit {
|
||||
/**
|
||||
* @param {FormBuilder} formBuilder Form Builder
|
||||
* @param {ReportsService} reportService Reports Service
|
||||
* @param {SettingsService} settingsService Settings Service.
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private reportService: ReportsService) {
|
||||
private reportService: ReportsService,
|
||||
private settingsService: SettingsService) {
|
||||
this.createSMSCampaignDetailsForm();
|
||||
}
|
||||
|
||||
@@ -66,6 +69,7 @@ export class EditSmsCampaignStepComponent implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.maxDate = this.settingsService.businessDate;
|
||||
this.triggerTypes = this.smsCampaignTemplate.triggerTypeOptions;
|
||||
this.smsProviders = this.smsCampaignTemplate.smsProviderOptions;
|
||||
this.businessRules = this.smsCampaignTemplate.businessRulesOptions;
|
||||
|
||||
+6
-2
@@ -1,5 +1,5 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnChanges, Input, Output, EventEmitter } from '@angular/core';
|
||||
import { Component, OnChanges, Input, Output, EventEmitter, OnInit } from '@angular/core';
|
||||
import { Validators, FormGroup, FormControl } from '@angular/forms';
|
||||
|
||||
/** Custom Services */
|
||||
@@ -19,7 +19,7 @@ import { Dates } from 'app/core/utils/dates';
|
||||
templateUrl: './business-rule-parameters.component.html',
|
||||
styleUrls: ['./business-rule-parameters.component.scss']
|
||||
})
|
||||
export class BusinessRuleParametersComponent implements OnChanges {
|
||||
export class BusinessRuleParametersComponent implements OnInit, OnChanges {
|
||||
|
||||
/** Run Report Parameters Data */
|
||||
@Input() paramData: any;
|
||||
@@ -47,6 +47,10 @@ export class BusinessRuleParametersComponent implements OnChanges {
|
||||
private settingsService: SettingsService,
|
||||
private dateUtils: Dates) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
this.maxDate = this.settingsService.businessDate;
|
||||
}
|
||||
|
||||
ngOnChanges() {
|
||||
if (this.paramData) {
|
||||
this.ReportForm = new FormGroup({});
|
||||
|
||||
@@ -92,8 +92,8 @@ export class ViewCampaignComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
this.maxDate = this.settingsService.businessDate;
|
||||
this.createSMSForm();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user