Skip to content

v2.1.0 - unified links; simplify TimeZone using ZonedExtra class

Compare
Choose a tag to compare
@bxparks bxparks released this 30 Jan 03:51
· 234 commits to master since this release
  • 2.1.0 (2023-01-29, TZDB version 2022g)
    • There are a handful API breaking changes in this release in the pursuit of
      simpler and cleaner code. See the following for more info:
    • Potentially Breaking: zonedb,zonedbx
      • Rename kPolicyXxx to kZonePolicyXxx for consistency. These are
        expected to be used only internally, so shouldn't cause external
        breakage.
    • Breaking: TimeZone.h
      • Replace 3 separate extraction methods in TimeZone with a new
        ZonedExtra class
      • Removed: TimeZone::getUtcOffset()
        • Replaced by: ZonedExtra::timeOffset()
      • Removed: TimeZone::getDeltaOffset()
        • Replaced by: ZonedExtra::dstOffset()
      • Removed TimeZone::getAbbrev()
        • Replaced by: ZonedExtra::abbrev()
        • ZonedExtra::abbrev() returns pointer to a local string buffer
          instead of a transient buffer deep inside Transition object.
        • TimeZone becomes closer to being thread-safe
    • New Class: ZonedExtra.h
      • ZonedExtra::forEpochSeconds(epochSeconds, tz)
        • Create instance from epochSeconds and time zone.
      • ZonedExtra::forLocalDateTime(ldt, tz)
        • Create instance from LocalDateTime and time zone.
    • Potentially Breaking: Unified Links
      • Links are now first-class citizens, exactly the same as Zones.
      • Unify "fat links" and "symbolic links" into a single implementation.
      • Remove "thin links" to simplify the code.
      • TimeZone class simplified
        • Removed followLink flag on various methods.
        • Only 2 methods apply to Links: isLink() and
          printTargetNameTo().
    • Simplify ZoneProcessors
      • ZoneProcessor.h, ExtendedZoneProcessor.h, BasicZoneProcessor.h
      • Remove: getUtcOffset(), getDeltaOffset(), getAbbrev()
      • Replaced by: findByLocalDateTime(), findByEpochSeconds()
      • These are internal helper methods not intended for public consumption.
    • Unit tests
      • Migrate most unit tests to use the smaller, testing zone databases at
        testing/tzonedb/ and testing/tzonedbx/.
        • Reduces maintenance cost of various hand-crafted ZoneInfo and
          ZonePolicy entries for unit tests.
        • Can test against real timezones with predictable behavior.