From 86d8179e4f8bdacc0612c3936f6e84acf1d81e0b Mon Sep 17 00:00:00 2001 From: Jacob Baskin Date: Tue, 1 Aug 2017 12:16:17 -0400 Subject: [PATCH] fix: Ioutput dates as ISO 8601 strings in JSON Formatter (#313) kudos to @jacobbaskin --- lib/utils/JsonFormatterPipe.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/utils/JsonFormatterPipe.ts b/lib/utils/JsonFormatterPipe.ts index 8de93236a1..af821d22db 100644 --- a/lib/utils/JsonFormatterPipe.ts +++ b/lib/utils/JsonFormatterPipe.ts @@ -35,6 +35,8 @@ function valueToHTML(value) { level++; output += arrayToHTML(value); level--; + } else if (value && value.constructor === Date) { + output += decorateWithSpan('"' + value.toISOString() + '"', 'type-string'); } else if (valueType === 'object') { level++; output += objectToHTML(value);