From 6428ce0c8b6f691dbd26c7fe7f11396fdd364d25 Mon Sep 17 00:00:00 2001 From: Charlie Gordon Date: Sun, 25 Feb 2024 22:53:29 +0100 Subject: [PATCH] show readable representation of Date objects in repl --- repl.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/repl.js b/repl.js index 42aaa84..9f8ca4b 100644 --- a/repl.js +++ b/repl.js @@ -1005,6 +1005,8 @@ import * as os from "os"; std.puts(a); } else if (stack.indexOf(a) >= 0) { std.puts("[circular]"); + } else if (a instanceof Date) { + std.puts("Date " + a.toGMTString().__quote()); } else if (has_jscalc && (a instanceof Fraction || a instanceof Complex || a instanceof Mod ||