mirror of
https://github.com/RGBCube/serenity
synced 2025-07-02 22:22:07 +00:00
LibTimeZone: Handle time zones which begin the year in daylight savings
This commit is contained in:
parent
7103012c7d
commit
1f051a8e25
2 changed files with 13 additions and 2 deletions
|
@ -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 };
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue