Import of CCTZ from GitHub.

PiperOrigin-RevId: 467992681
Change-Id: I086b3da8dd95b0498d5bc118b9243052586239e6
pull/1252/head
Abseil Team 2 years ago committed by Copybara-Service
parent f4b2faaa44
commit 547802119d
  1. 7
      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.

Loading…
Cancel
Save