Hotfix Prep (#2484)

This commit is contained in:
Joe Milazzo 2023-12-10 12:47:25 -06:00 committed by GitHub
parent 8c16b87ff0
commit bd4cbeb393
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 114 additions and 87 deletions

View file

@ -15,7 +15,8 @@ type UtcToLocalTimeFormat = 'full' | 'short' | 'shortDate' | 'shortTime';
})
export class UtcToLocalTimePipe implements PipeTransform {
transform(utcDate: string, format: UtcToLocalTimeFormat = 'short'): string {
transform(utcDate: string | undefined | null, format: UtcToLocalTimeFormat = 'short'): string {
if (utcDate === undefined || utcDate === null) return '';
const browserLanguage = navigator.language;
const dateTime = DateTime.fromISO(utcDate, { zone: 'utc' }).toLocal().setLocale(browserLanguage);