sardell commented on a change in pull request #1495: METRON-2211: [UI] Alerts
UI should optionally render timestamp in local time
URL: https://github.com/apache/metron/pull/1495#discussion_r321648773
##########
File path:
metron-interface/metron-alerts/src/app/alerts/alerts-list/table-view/table-view.component.ts
##########
@@ -187,9 +191,12 @@ export class TableViewComponent implements OnInit,
OnChanges, OnDestroy {
}
formatValue(column: ColumnMetadata, returnValue: string) {
+ this.localTime = this.timezoneConfigService.getTimezoneConfig();
try {
- if (column.name.endsWith(':ts') || column.name.endsWith('timestamp')) {
- returnValue = new Date(parseInt(returnValue,
10)).toISOString().replace('T', ' ').slice(0, 19);
+ if ((column.name.endsWith(':ts') || column.name.endsWith('timestamp'))
&& this.localTime === true) {
+ returnValue = moment.utc(returnValue).local().format('YYYY-MM-DD
H:mm:ss');
Review comment:
That's correct, it references the user's location. Specifically, it
references the location in their computer's OS time settings.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services