Move out DatePipe to use in one place Dates
This commit is contained in:
+4
-4
@@ -2,7 +2,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { SelectionModel } from '@angular/cdk/collections';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { MatTableDataSource } from '@angular/material/table';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
|
||||
@@ -12,6 +11,7 @@ import { ConfirmationDialogComponent } from 'app/shared/confirmation-dialog/conf
|
||||
/** Custom Services */
|
||||
import { TasksService } from '../../tasks.service';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
@Component({
|
||||
selector: 'mifosx-loan-disbursal',
|
||||
@@ -35,14 +35,14 @@ export class LoanDisbursalComponent {
|
||||
* Retrieves the loans data from `resolve`.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {Dialog} dialog MatDialog.
|
||||
* @param {DatePipe} datePipe Date Utils.
|
||||
* @param {Dates} dateUtils Date Utils.
|
||||
* @param {router} router Router.
|
||||
* @param {SettingsService} settingsService Settings Service.
|
||||
* @param {TasksService} tasksService Tasks Service.
|
||||
*/
|
||||
constructor(private route: ActivatedRoute,
|
||||
private dialog: MatDialog,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private settingsService: SettingsService,
|
||||
private tasksService: TasksService) {
|
||||
this.route.data.subscribe((data: { loansData: any }) => {
|
||||
@@ -90,7 +90,7 @@ export class LoanDisbursalComponent {
|
||||
|
||||
bulkLoanDisbursal() {
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const approvedOnDate = this.datePipe.transform(new Date(), dateFormat);
|
||||
const approvedOnDate = this.dateUtils.formatDate(new Date(), dateFormat);
|
||||
const locale = this.settingsService.language.code;
|
||||
const formData = {
|
||||
dateFormat,
|
||||
|
||||
Reference in New Issue
Block a user