UI is broken in dates parsing in Safari

This commit is contained in:
Jose Alberto Hernandez
2022-06-22 15:33:50 -05:00
parent 3d1c41badc
commit 9bf535da18
113 changed files with 268 additions and 235 deletions
+24
View File
@@ -0,0 +1,24 @@
import { Pipe, PipeTransform } from '@angular/core';
import { SettingsService } from 'app/settings/settings.service';
import * as moment from 'moment';
@Pipe({
name: 'dateFormat'
})
export class DateFormatPipe implements PipeTransform {
defaultDateFormat: string;
constructor(private settingsService: SettingsService) {
this.defaultDateFormat = this.settingsService.dateFormat;
this.defaultDateFormat = this.defaultDateFormat.replace('dd', 'DD');
}
transform(value: Date | moment.Moment, dateFormat: string): any {
if (dateFormat == null) {
return moment(value).format(this.defaultDateFormat);
}
return moment(value).format(dateFormat);
}
}