Skip to content

Commit d1d2294

Browse files
committed
fix: Resolved NullInjector issue what was leading to console errors and tooltip visual bugs
1 parent 18fc782 commit d1d2294

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
import {Inject, LOCALE_ID, Pipe, PipeTransform} from '@angular/core';
2-
import {DatePipe} from "@angular/common";
2+
import {formatDate} from "@angular/common";
33

44
@Pipe({
55
name: 'authorshipDateFormat',
66
standalone: true
77
})
88
export class AuthorshipDateFormatPipe implements PipeTransform {
9-
constructor(private datePipe: DatePipe, @Inject(LOCALE_ID) private locale: string) {
9+
constructor(@Inject(LOCALE_ID) private locale: string) {
1010
}
1111

1212
transform(dateTime: string) {
1313
if (!dateTime) return;
14-
return this.datePipe.transform(dateTime);
14+
try {
15+
return formatDate(dateTime, 'mediumDate', this.locale);
16+
} catch {
17+
return;
18+
}
1519
}
1620

1721
}

0 commit comments

Comments
 (0)