import Metric from "../../../classes/Metric" ; import { MetricType } from "../../../classes/MetricType" ; export default class MetricKeyFormatter { public static formatMeasureValue ( metric , value ? ) { if ( ! value ) { return "n/a" ; } if ( metric . type === MetricType . MILLISEC ) { return this . convertMillisecondsToDigitalClock ( + value ) ; } return value + "" ; } private static convertMillisecondsToDigitalClock ( milliseconds ) { const date = new Date ( milliseconds ) ; return date . toLocaleDateString ( ) ; } }