summaryrefslogtreecommitdiff
path: root/Userland/Utilities/js.cpp
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2022-01-14 17:55:11 -0500
committerLinus Groh <mail@linusgroh.de>2022-01-15 20:13:48 +0100
commit58ccca6a9dba937ee7c4b48592962be06955688a (patch)
tree6ca93ee923493fe8e8f38273ab44b93b9aba34d3 /Userland/Utilities/js.cpp
parentd83ce7dd0bf4a151ff465378cdac38d845ac9c9f (diff)
downloadserenity-58ccca6a9dba937ee7c4b48592962be06955688a.zip
LibJS+js: Pretty-print Date objects using the ToDateString AO
Diffstat (limited to 'Userland/Utilities/js.cpp')
-rw-r--r--Userland/Utilities/js.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Utilities/js.cpp b/Userland/Utilities/js.cpp
index 0fae2e8abf..be9b825450 100644
--- a/Userland/Utilities/js.cpp
+++ b/Userland/Utilities/js.cpp
@@ -27,6 +27,7 @@
#include <LibJS/Runtime/BooleanObject.h>
#include <LibJS/Runtime/DataView.h>
#include <LibJS/Runtime/Date.h>
+#include <LibJS/Runtime/DatePrototype.h>
#include <LibJS/Runtime/ECMAScriptFunctionObject.h>
#include <LibJS/Runtime/Error.h>
#include <LibJS/Runtime/FunctionObject.h>
@@ -311,7 +312,7 @@ static void print_function(JS::Object const& object, HashTable<JS::Object*>&)
static void print_date(JS::Object const& object, HashTable<JS::Object*>&)
{
print_type("Date");
- js_out(" \033[34;1m{}\033[0m", static_cast<JS::Date const&>(object).string());
+ js_out(" \033[34;1m{}\033[0m", JS::to_date_string(static_cast<JS::Date const&>(object).date_value()));
}
static void print_error(JS::Object const& object, HashTable<JS::Object*>& seen_objects)