fix date, init order

This commit is contained in:
_Bastler 2021-12-15 13:11:20 +01:00
parent 89bdb49662
commit 6158076c44
3 changed files with 7 additions and 1 deletions

View File

@ -17,6 +17,7 @@ export class PermissionsComponent implements OnInit {
ngOnInit(): void {
this.datetimeformat = this.i18n.get('format.datetime', []);
this.sortData({ "active": "name", "direction": "asc" });
}
sortData(sort: Sort) {

View File

@ -16,6 +16,7 @@ export class QuotasComponent implements OnInit {
constructor(private i18n: I18nService) {}
ngOnInit(): void {
this.sortData({ "active": "name", "direction": "asc" });
}
sortData(sort: Sort) {

View File

@ -4,10 +4,14 @@ import * as moment from 'moment';
@Pipe({ name: 'datef' })
export class MomentPipe implements PipeTransform {
transform(value: Date | moment.Moment, dateFormat: string): any {
if (!value) {
return "";
}
if (!dateFormat) {
return moment(value).fromNow();
}
return moment(value).format(dateFormat);
}
}