mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 23:25:20 +00:00
Userland: Fix compile errors from merging a PR without re-running CI
Hands have been slapped, more CI buttons should be pushed now D:
This commit is contained in:
@@ -134,9 +134,9 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<JS::Date>> parse_date_string(JS::Realm& rea
|
||||
// FIXME: Implement spec compliant date string parsing
|
||||
auto parts = value.split_view('-');
|
||||
if (parts.size() >= 3) {
|
||||
if (auto year = parts.at(0).to_uint(); year.has_value()) {
|
||||
if (auto month = parts.at(1).to_uint(); month.has_value()) {
|
||||
if (auto day_of_month = parts.at(2).to_uint(); day_of_month.has_value())
|
||||
if (auto year = parts.at(0).to_number<u32>(); year.has_value()) {
|
||||
if (auto month = parts.at(1).to_number<u32>(); month.has_value()) {
|
||||
if (auto day_of_month = parts.at(2).to_number<u32>(); day_of_month.has_value())
|
||||
return JS::Date::create(realm, JS::make_date(JS::make_day(*year, *month - 1, *day_of_month), 0));
|
||||
}
|
||||
}
|
||||
@@ -219,10 +219,10 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<JS::Date>> parse_time_string(JS::Realm& rea
|
||||
// FIXME: Implement spec compliant time string parsing
|
||||
auto parts = value.split_view(':');
|
||||
if (parts.size() >= 2) {
|
||||
if (auto hours = parts.at(0).to_uint(); hours.has_value()) {
|
||||
if (auto minutes = parts.at(1).to_uint(); minutes.has_value()) {
|
||||
if (auto hours = parts.at(0).to_number<u32>(); hours.has_value()) {
|
||||
if (auto minutes = parts.at(1).to_number<u32>(); minutes.has_value()) {
|
||||
if (parts.size() >= 3) {
|
||||
if (auto seconds = parts.at(2).to_uint(); seconds.has_value())
|
||||
if (auto seconds = parts.at(2).to_number<u32>(); seconds.has_value())
|
||||
return JS::Date::create(realm, JS::make_time(*hours, *minutes, *seconds, 0));
|
||||
}
|
||||
return JS::Date::create(realm, JS::make_date(0, JS::make_time(*hours, *minutes, 0, 0)));
|
||||
|
||||
Reference in New Issue
Block a user