Hotfix Prep (#2484)
This commit is contained in:
parent
8c16b87ff0
commit
bd4cbeb393
22 changed files with 114 additions and 87 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue