fix date, init order
This commit is contained in:
parent
89bdb49662
commit
6158076c44
@ -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) {
|
||||
|
@ -16,6 +16,7 @@ export class QuotasComponent implements OnInit {
|
||||
constructor(private i18n: I18nService) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.sortData({ "active": "name", "direction": "asc" });
|
||||
}
|
||||
|
||||
sortData(sort: Sort) {
|
||||
|
@ -4,6 +4,10 @@ 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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user