summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2022-08-16 12:20:55 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2022-08-16 12:21:40 -0700
commit547802119dfa444540d8f2bb8a9f50bf64252a0f (patch)
tree47530e6d50c433c1c478d414c4a5125a762b1803
parentf4b2faaa440827266aaf371917736b8fba854cf3 (diff)
Import of CCTZ from GitHub.
PiperOrigin-RevId: 467992681 Change-Id: I086b3da8dd95b0498d5bc118b9243052586239e6
-rw-r--r--absl/time/internal/cctz/src/time_zone_info.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/absl/time/internal/cctz/src/time_zone_info.cc b/absl/time/internal/cctz/src/time_zone_info.cc
index a2617d5e..8966f7ac 100644
--- a/absl/time/internal/cctz/src/time_zone_info.cc
+++ b/absl/time/internal/cctz/src/time_zone_info.cc
@@ -349,7 +349,6 @@ bool TimeZoneInfo::ExtendTransitions() {
PosixTimeZone posix;
if (!ParsePosixSpec(future_spec_, &posix)) return false;
- if (AllYearDST(posix)) return true; // last transition still prevails
// Find transition type for the future std specification.
std::uint_least8_t std_ti;
@@ -367,6 +366,12 @@ bool TimeZoneInfo::ExtendTransitions() {
if (!GetTransitionType(posix.dst_offset, true, posix.dst_abbr, &dst_ti))
return false;
+ if (AllYearDST(posix)) { // dst only
+ // The future specification should match the last transition, and
+ // that means that handling the future will fall out naturally.
+ return EquivTransitions(transitions_.back().type_index, dst_ti);
+ }
+
// Extend the transitions for an additional 400 years using the
// future specification. Years beyond those can be handled by
// mapping back to a cycle-equivalent year within that range.