mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-02 04:27:12 +02:00
LibTimeZone: Handle time zones which begin the year in daylight savings
This commit is contained in:
committed by
Linus Groh
parent
7103012c7d
commit
1f051a8e25
Notes:
sideshowbarker
2024-07-17 20:15:47 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/1f051a8e25c Pull-request: https://github.com/SerenityOS/serenity/pull/12119 Reviewed-by: https://github.com/linusg ✅
@@ -545,8 +545,14 @@ static Offset get_active_dst_offset(TimeZoneOffset const& time_zone_offset, AK::
|
||||
auto standard_time_in_effect = offsets[0]->time_in_effect(time);
|
||||
auto daylight_time_in_effect = offsets[1]->time_in_effect(time);
|
||||
|
||||
if ((time < daylight_time_in_effect) || (time >= standard_time_in_effect))
|
||||
return { offsets[0]->offset, InDST::No };
|
||||
if (daylight_time_in_effect < standard_time_in_effect) {
|
||||
if ((time < daylight_time_in_effect) || (time >= standard_time_in_effect))
|
||||
return { offsets[0]->offset, InDST::No };
|
||||
} else {
|
||||
if ((time >= standard_time_in_effect) && (time < daylight_time_in_effect))
|
||||
return { offsets[0]->offset, InDST::No };
|
||||
}
|
||||
|
||||
return { offsets[1]->offset, InDST::Yes };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user