@@ -7,6 +7,7 @@ import { DatePipe } from '@angular/common';
|
||||
/** Custom Components */
|
||||
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
|
||||
import { DeleteDialogComponent } from '../../../../shared/delete-dialog/delete-dialog.component';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
|
||||
/** Custom Models */
|
||||
import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-base';
|
||||
@@ -40,11 +41,13 @@ export class SingleRowComponent implements OnInit {
|
||||
* @param {DatePipe} datePipe Date Pipe.
|
||||
* @param {LoansService} loansService Loans Service.
|
||||
* @param {MatDialog} dialog Mat Dialog.
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private route: ActivatedRoute,
|
||||
private datePipe: DatePipe,
|
||||
private dialog: MatDialog,
|
||||
private loansService: LoansService) {
|
||||
private loansService: LoansService,
|
||||
private settingsService: SettingsService) {
|
||||
this.loanId = this.route.parent.parent.snapshot.paramMap.get('loanId');
|
||||
}
|
||||
|
||||
@@ -62,7 +65,7 @@ export class SingleRowComponent implements OnInit {
|
||||
* Creates a new instance of the given single row data table.
|
||||
*/
|
||||
add() {
|
||||
let dataTableEntryObject: any = { locale: 'en' };
|
||||
let dataTableEntryObject: any = { locale: this.settingsService.language.code };
|
||||
const dateTransformColumns: string[] = [];
|
||||
const columns = this.dataObject.columnHeaders.filter((column: any) => {
|
||||
return ((column.columnName !== 'id') && (column.columnName !== 'loan_id'));
|
||||
@@ -92,7 +95,7 @@ export class SingleRowComponent implements OnInit {
|
||||
* Edits the current instance of single row data table.
|
||||
*/
|
||||
edit() {
|
||||
let dataTableEntryObject: any = { locale: 'en' };
|
||||
let dataTableEntryObject: any = { locale: this.settingsService.language.code };
|
||||
const dateTransformColumns: string[] = [];
|
||||
const columns = this.dataObject.columnHeaders.filter((column: any) => {
|
||||
return ((column.columnName !== 'id') && (column.columnName !== 'loan_id'));
|
||||
@@ -177,7 +180,7 @@ export class SingleRowComponent implements OnInit {
|
||||
});
|
||||
case 'DATE': {
|
||||
dateTransformColumns.push(column.columnName);
|
||||
dataTableEntryObject.dateFormat = 'yyyy-MM-dd';
|
||||
dataTableEntryObject.dateFormat = this.settingsService.dateFormat;
|
||||
return new DatepickerBase({
|
||||
controlName: column.columnName,
|
||||
label: column.columnName,
|
||||
|
||||
Reference in New Issue
Block a user