summaryrefslogtreecommitdiff
path: root/Meta/Lagom/Tools
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2022-01-24 13:33:19 -0500
committerLinus Groh <mail@linusgroh.de>2022-01-25 18:39:36 +0000
commit1f051a8e25c758c99bbd905b58b46537665b6e9a (patch)
tree5e7feb62fe2bf2d7d02870ed055dd328718beba8 /Meta/Lagom/Tools
parent7103012c7d447c1ba3d18597b086ae868661f82e (diff)
downloadserenity-1f051a8e25c758c99bbd905b58b46537665b6e9a.zip
LibTimeZone: Handle time zones which begin the year in daylight savings
Diffstat (limited to 'Meta/Lagom/Tools')
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibTimeZone/GenerateTimeZoneData.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibTimeZone/GenerateTimeZoneData.cpp b/Meta/Lagom/Tools/CodeGenerators/LibTimeZone/GenerateTimeZoneData.cpp
index 264e523bb7..524955e226 100644
--- a/Meta/Lagom/Tools/CodeGenerators/LibTimeZone/GenerateTimeZoneData.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibTimeZone/GenerateTimeZoneData.cpp
@@ -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 };
}