Skip to content

Commit 5478021

Browse files
Abseil Teamcopybara-github
Abseil Team
authored andcommitted
Import of CCTZ from GitHub.
PiperOrigin-RevId: 467992681 Change-Id: I086b3da8dd95b0498d5bc118b9243052586239e6
1 parent f4b2faa commit 5478021

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

absl/time/internal/cctz/src/time_zone_info.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,6 @@ bool TimeZoneInfo::ExtendTransitions() {
349349

350350
PosixTimeZone posix;
351351
if (!ParsePosixSpec(future_spec_, &posix)) return false;
352-
if (AllYearDST(posix)) return true; // last transition still prevails
353352

354353
// Find transition type for the future std specification.
355354
std::uint_least8_t std_ti;
@@ -367,6 +366,12 @@ bool TimeZoneInfo::ExtendTransitions() {
367366
if (!GetTransitionType(posix.dst_offset, true, posix.dst_abbr, &dst_ti))
368367
return false;
369368

369+
if (AllYearDST(posix)) { // dst only
370+
// The future specification should match the last transition, and
371+
// that means that handling the future will fall out naturally.
372+
return EquivTransitions(transitions_.back().type_index, dst_ti);
373+
}
374+
370375
// Extend the transitions for an additional 400 years using the
371376
// future specification. Years beyond those can be handled by
372377
// mapping back to a cycle-equivalent year within that range.

0 commit comments

Comments
 (0)