|
@@ -67,6 +67,7 @@ void DatePrototype::initialize(GlobalObject& global_object)
|
|
define_native_function("getSeconds", get_seconds, 0, attr);
|
|
define_native_function("getSeconds", get_seconds, 0, attr);
|
|
define_native_function("getTime", get_time, 0, attr);
|
|
define_native_function("getTime", get_time, 0, attr);
|
|
define_native_function("toDateString", to_date_string, 0, attr);
|
|
define_native_function("toDateString", to_date_string, 0, attr);
|
|
|
|
+ define_native_function("toISOString", to_iso_string, 0, attr);
|
|
define_native_function("toLocaleDateString", to_locale_date_string, 0, attr);
|
|
define_native_function("toLocaleDateString", to_locale_date_string, 0, attr);
|
|
define_native_function("toLocaleString", to_locale_string, 0, attr);
|
|
define_native_function("toLocaleString", to_locale_string, 0, attr);
|
|
define_native_function("toLocaleTimeString", to_locale_time_string, 0, attr);
|
|
define_native_function("toLocaleTimeString", to_locale_time_string, 0, attr);
|
|
@@ -169,6 +170,15 @@ JS_DEFINE_NATIVE_FUNCTION(DatePrototype::to_date_string)
|
|
return js_string(interpreter, move(string));
|
|
return js_string(interpreter, move(string));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+JS_DEFINE_NATIVE_FUNCTION(DatePrototype::to_iso_string)
|
|
|
|
+{
|
|
|
|
+ auto* this_object = typed_this(interpreter, global_object);
|
|
|
|
+ if (!this_object)
|
|
|
|
+ return {};
|
|
|
|
+ auto string = this_object->iso_date_string();
|
|
|
|
+ return js_string(interpreter, move(string));
|
|
|
|
+}
|
|
|
|
+
|
|
JS_DEFINE_NATIVE_FUNCTION(DatePrototype::to_locale_date_string)
|
|
JS_DEFINE_NATIVE_FUNCTION(DatePrototype::to_locale_date_string)
|
|
{
|
|
{
|
|
auto* this_object = typed_this(interpreter, global_object);
|
|
auto* this_object = typed_this(interpreter, global_object);
|