Datepickers using max date with business date
This commit is contained in:
committed by
Arnold Gálovics
parent
753791a078
commit
a4b266080b
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user