LibJS: Replace the broken and unused Date::year getter

This commit is contained in:
Idan Horowitz 2021-05-29 23:51:15 +03:00 committed by Linus Groh
parent a7c265f341
commit 96ee5e36ed
Notes: sideshowbarker 2024-07-18 17:11:31 +09:00
2 changed files with 2 additions and 3 deletions

View file

@ -25,14 +25,13 @@ public:
int date() const { return datetime().day(); }
int day() const { return datetime().weekday(); }
int full_year() const { return datetime().year(); }
int hours() const { return datetime().hour(); }
u16 milliseconds() const { return m_milliseconds; }
int minutes() const { return datetime().minute(); }
int month() const { return datetime().month() - 1; }
int seconds() const { return datetime().second(); }
double time() const { return datetime().timestamp() * 1000.0 + milliseconds(); }
int year() const { return datetime().day(); }
int year() const { return datetime().year(); }
bool is_invalid() const { return m_is_invalid; }
void set_is_invalid(bool value) { m_is_invalid = value; }

View file

@ -115,7 +115,7 @@ JS_DEFINE_NATIVE_FUNCTION(DatePrototype::get_full_year)
if (this_object->is_invalid())
return js_nan();
return Value(this_object->full_year());
return Value(this_object->year());
}
JS_DEFINE_NATIVE_FUNCTION(DatePrototype::set_full_year)