Format date fields without patch form

This commit is contained in:
Jose Alberto Hernandez
2022-06-10 10:34:19 +02:00
committed by Arnold Gálovics
parent 9d43181cea
commit 6ea3d97538
191 changed files with 1408 additions and 1173 deletions
@@ -32,4 +32,4 @@
</form>
<iframe *ngIf="!hideOutput" [src]="pentahoUrl" frameborder="0" width=100% height="750px;"></iframe>
<iframe *ngIf="!hideOutput" [src]="pentahoUrl" frameborder="0" width="100%" height="750px;"></iframe>
@@ -2,12 +2,12 @@
import { Component, OnInit } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
import { FormBuilder, Validators } from '@angular/forms';
import { DatePipe } from '@angular/common';
import { ActivatedRoute } from '@angular/router';
/** Custom Services */
import { ReportsService } from 'app/reports/reports.service';
import { SettingsService } from 'app/settings/settings.service';
import { Dates } from 'app/core/utils/dates';
/**
* Export Client Savings Transactions Component
@@ -37,14 +37,14 @@ export class ExportTransactionsComponent implements OnInit {
* @param {DomSanitizer} sanitizer DOM Sanitizer
* @param {ReportsService} reportsService Reports Service
* @param {FormBuilder} formBuilder Form Builder
* @param {DatePipe} datePipe Date Pipe
* @param {Dates} dateUtils Date Utils
* @param {ActivatedRoute} route Activated Route
* @param {SettingsService} settingsService Settings Service
*/
constructor(private sanitizer: DomSanitizer,
private reportsService: ReportsService,
private formBuilder: FormBuilder,
private datePipe: DatePipe,
private dateUtils: Dates,
private route: ActivatedRoute,
private settingsService: SettingsService) {
this.route.parent.parent.data.subscribe((data: { savingsAccountData: any }) => {
@@ -73,8 +73,8 @@ export class ExportTransactionsComponent implements OnInit {
generate() {
const data = {
'output-type': 'PDF',
R_startDate: this.datePipe.transform(this.transactionsReportForm.value.fromDate, this.settingsService.dateFormat),
R_endDate: this.datePipe.transform(this.transactionsReportForm.value.toDate, this.settingsService.dateFormat),
R_startDate: this.dateUtils.formatDate(this.transactionsReportForm.value.fromDate, this.settingsService.dateFormat),
R_endDate: this.dateUtils.formatDate(this.transactionsReportForm.value.toDate, this.settingsService.dateFormat),
R_savingsAccountId: this.savingsAccountId
};
this.reportsService.getPentahoRunReportData('Client Saving Transactions', data, 'default', this.settingsService.language.code, this.settingsService.dateFormat)