Fix for Loan repayment issues
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
import { Dates } from './dates';
|
||||
|
||||
describe('Dates', () => {
|
||||
it('should create an instance', () => {
|
||||
expect(new Dates()).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,17 @@
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class Dates {
|
||||
|
||||
constructor(private settingsService: SettingsService,
|
||||
private datePipe: DatePipe) {}
|
||||
|
||||
public getDate(timestamp: any) {
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
return this.datePipe.transform(timestamp, dateFormat);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user