Fineract backend settings with environment variables

This commit is contained in:
Jose Alberto Hernandez
2022-07-13 16:40:23 +02:00
committed by Arnold Gálovics
parent 1b72136411
commit 14ceb4f3fd
44 changed files with 815 additions and 291 deletions
+10 -2
View File
@@ -1,6 +1,7 @@
import { DatePipe } from '@angular/common';
import { Injectable } from '@angular/core';
import { SettingsService } from 'app/settings/settings.service';
import * as moment from 'moment';
@Injectable({
providedIn: 'root'
@@ -10,13 +11,20 @@ export class Dates {
constructor(private settingsService: SettingsService,
private datePipe: DatePipe) {}
public getDate(timestamp: any) {
public getDate(timestamp: any): string {
const dateFormat = this.settingsService.dateFormat;
return this.datePipe.transform(timestamp, dateFormat);
}
public formatDate(timestamp: any, dateFormat: string) {
public formatDate(timestamp: any, dateFormat: string): string {
return this.datePipe.transform(timestamp, dateFormat);
}
public parseDate(value: any): Date {
if (value instanceof Array) {
return moment(value.join('-'), 'YYYY-MM-DD').toDate();
} else {
return moment(value).toDate();
}
}
}