mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-24 10:12:25 -05:00
LibJS: Add Date.setUTC{Date, Month, Hours, ...}() aliases
These are a bit hacky, since they are supposed to be separate methods, but since serenity only supports UTC currently, they are equivalent.
This commit is contained in:
parent
46214f0657
commit
60e70e5ee4
Notes:
sideshowbarker
2024-07-18 12:44:30 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/60e70e5ee45 Pull-request: https://github.com/SerenityOS/serenity/pull/7845 Reviewed-by: https://github.com/linusg
2 changed files with 14 additions and 0 deletions
|
@ -224,6 +224,13 @@ namespace JS {
|
|||
P(setPrototypeOf) \
|
||||
P(setSeconds) \
|
||||
P(setTime) \
|
||||
P(setUTCDate) \
|
||||
P(setUTCFullYear) \
|
||||
P(setUTCHours) \
|
||||
P(setUTCMilliseconds) \
|
||||
P(setUTCMinutes) \
|
||||
P(setUTCMonth) \
|
||||
P(setUTCSeconds) \
|
||||
P(setYear) \
|
||||
P(shift) \
|
||||
P(sign) \
|
||||
|
|
|
@ -59,13 +59,20 @@ void DatePrototype::initialize(GlobalObject& global_object)
|
|||
define_native_function(vm.names.setTime, set_time, 1, attr);
|
||||
define_native_function(vm.names.getTimezoneOffset, get_timezone_offset, 0, attr);
|
||||
define_native_function(vm.names.getUTCDate, get_utc_date, 0, attr);
|
||||
define_native_function(vm.names.setUTCDate, set_date, 1, attr); // FIXME: This is a hack, Serenity doesn't currently support timezones other than UTC.
|
||||
define_native_function(vm.names.getUTCDay, get_utc_day, 0, attr);
|
||||
define_native_function(vm.names.getUTCFullYear, get_utc_full_year, 0, attr);
|
||||
define_native_function(vm.names.setUTCFullYear, set_full_year, 3, attr); // FIXME: see above
|
||||
define_native_function(vm.names.getUTCHours, get_utc_hours, 0, attr);
|
||||
define_native_function(vm.names.setUTCHours, set_hours, 4, attr); // FIXME: see above
|
||||
define_native_function(vm.names.getUTCMilliseconds, get_utc_milliseconds, 0, attr);
|
||||
define_native_function(vm.names.setUTCMilliseconds, set_milliseconds, 1, attr); // FIXME: see above
|
||||
define_native_function(vm.names.getUTCMinutes, get_utc_minutes, 0, attr);
|
||||
define_native_function(vm.names.setUTCMinutes, set_minutes, 3, attr); // FIXME: see above
|
||||
define_native_function(vm.names.getUTCMonth, get_utc_month, 0, attr);
|
||||
define_native_function(vm.names.setUTCMonth, set_month, 2, attr); // FIXME: see above
|
||||
define_native_function(vm.names.getUTCSeconds, get_utc_seconds, 0, attr);
|
||||
define_native_function(vm.names.setUTCSeconds, set_seconds, 2, attr); // FIXME: see above
|
||||
define_native_function(vm.names.toDateString, to_date_string, 0, attr);
|
||||
define_native_function(vm.names.toUTCString, to_utc_string, 0, attr);
|
||||
define_native_function(vm.names.toISOString, to_iso_string, 0, attr);
|
||||
|
|
Loading…
Add table
Reference in a new issue