Datepickers using max date with business date

This commit is contained in:
Jose Alberto Hernandez
2022-07-28 17:06:39 +02:00
committed by Arnold Gálovics
parent 753791a078
commit a4b266080b
132 changed files with 268 additions and 42 deletions
+6 -5
View File
@@ -1,6 +1,5 @@
import { DatePipe } from '@angular/common';
import { Injectable } from '@angular/core';
import { SettingsService } from 'app/settings/settings.service';
import * as moment from 'moment';
@Injectable({
@@ -8,12 +7,10 @@ import * as moment from 'moment';
})
export class Dates {
constructor(private settingsService: SettingsService,
private datePipe: DatePipe) {}
constructor(private datePipe: DatePipe) {}
public getDate(timestamp: any): string {
const dateFormat = this.settingsService.dateFormat;
return this.datePipe.transform(timestamp, dateFormat);
return this.datePipe.transform(timestamp, 'YYYY-MM-DD');
}
public formatDate(timestamp: any, dateFormat: string): string {
@@ -27,4 +24,8 @@ export class Dates {
return moment(value).toDate();
}
}
public convertToDate(value: any, format: string): Date {
return moment(value).toDate();
}
}