From 444fc4b85c731b8e109fa82a7629790cc688ed14 Mon Sep 17 00:00:00 2001 From: John Rummell Date: Thu, 23 Jun 2022 15:04:54 -0700 Subject: [PATCH] Display keystatuseschange.expiration as a Date The values is the number of milliseconds from epoch which isn't readable, so display it as a Date if possible. --- eme-trace-config.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/eme-trace-config.js b/eme-trace-config.js index 2477cd7..2158cd9 100644 --- a/eme-trace-config.js +++ b/eme-trace-config.js @@ -336,6 +336,14 @@ function getSerializable(obj) { if (k.startsWith('__TraceAnything') || typeof obj[k] == 'function') { continue; } + + // 'keystatuseschange.expiration' is returned as a ECMAScript Time Value, + // so convert it into a Date if specified for better readability. + if (k == 'expiration' && !isNaN(obj[k])) { + clone[k] = getSerializable(new Date(obj[k])); + continue; + } + clone[k] = getSerializable(obj[k]); } // Make sure generated IDs get logged. Do this through a synthetic field.