Fixed invalid date showing on tasks screen
This commit is contained in:
parent
2dbaf555a5
commit
89452cc924
2 changed files with 5 additions and 2 deletions
|
|
@ -15,7 +15,8 @@ type UtcToLocalTimeFormat = 'full' | 'short' | 'shortDate' | 'shortTime';
|
||||||
})
|
})
|
||||||
export class UtcToLocalTimePipe implements PipeTransform {
|
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 browserLanguage = navigator.language;
|
||||||
const dateTime = DateTime.fromISO(utcDate, { zone: 'utc' }).toLocal().setLocale(browserLanguage);
|
const dateTime = DateTime.fromISO(utcDate, { zone: 'utc' }).toLocal().setLocale(browserLanguage);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,9 @@
|
||||||
<td>
|
<td>
|
||||||
{{task.title | titlecase}}
|
{{task.title | titlecase}}
|
||||||
</td>
|
</td>
|
||||||
<td>{{task.lastExecutionUtc | utcToLocalTime | defaultValue }}</td>
|
<td>
|
||||||
|
{{task.lastExecutionUtc | utcToLocalTime | defaultValue }}
|
||||||
|
</td>
|
||||||
<td>{{task.cron}}</td>
|
<td>{{task.cron}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue