LibJS: Use AK::abs in TimeZone

This fixes a `-Wabsolute-value` warning emitted because of our use of
`abs()` on arguments of type `long long`.
This commit is contained in:
Daniel Bertalan 2021-07-13 21:24:59 +02:00 committed by Andreas Kling
parent 6821cd45ed
commit cd55b817cf
Notes: sideshowbarker 2024-07-18 09:04:32 +09:00

View File

@ -210,7 +210,7 @@ String format_time_zone_offset_string(double offset_nanoseconds)
builder.append('-');
// 3. Let nanoseconds be abs(offsetNanoseconds) modulo 10^9.
auto nanoseconds = abs(offset) % 1000000000;
auto nanoseconds = AK::abs(offset) % 1000000000;
// 4. Let seconds be floor(offsetNanoseconds / 10^9) modulo 60.
auto seconds = (offset / 1000000000) % 60;