diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/logs/logs.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/logs/logs.component.html index a2c7d2389eb..c455894c1eb 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/logs/logs.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/logs/logs.component.html @@ -6,7 +6,7 @@

- {{ line.stamp }} + {{ line.stamp | cdDate }} {{ line.priority }} {{ line.message }}

@@ -22,7 +22,7 @@

- {{ line.stamp }} + {{ line.stamp | cdDate }} {{ line.priority }} {{ line.message }}

@@ -42,7 +42,7 @@ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/logs/logs.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/logs/logs.component.ts index cd20503c3a3..1ffc1610c7d 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/logs/logs.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/logs/logs.component.ts @@ -1,3 +1,4 @@ +import { DatePipe } from '@angular/common'; import { Component, OnDestroy, OnInit } from '@angular/core'; import { LogsService } from '../../../shared/api/logs.service'; @@ -28,7 +29,7 @@ export class LogsComponent implements OnInit, OnDestroy { selectedDate: Date; startTime: Date = new Date(); endTime: Date = new Date(); - constructor(private logsService: LogsService) { + constructor(private logsService: LogsService, private datePipe: DatePipe) { this.startTime.setHours(0, 0); this.endTime.setHours(23, 59); } @@ -81,8 +82,9 @@ export class LogsComponent implements OnInit, OnDestroy { filterExecutor(logs: Array, filters: any): Array { return logs.filter((line) => { - const hour = parseInt(line.stamp.slice(11, 13), 10); - const minutes = parseInt(line.stamp.slice(14, 16), 10); + const localDate = this.datePipe.transform(line.stamp, 'mediumTime'); + const hour = parseInt(localDate.split(':')[0], 10); + const minutes = parseInt(localDate.split(':')[1], 10); let prio: string, y_m_d: string, timeSpan: number; prio = filters.priority === 'All' ? line.priority : filters.priority;