Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge 2.3.0 into master #115

Merged
merged 108 commits into from
Jun 28, 2023
Merged

merge 2.3.0 into master #115

merged 108 commits into from
Jun 28, 2023

Conversation

bxparks
Copy link
Owner

@bxparks bxparks commented Jun 28, 2023

Major Changes in v2.3: Add CompleteZoneProcessor, CompleteZoneManager,
and the zonedbc database to support all timezones, for all transitions defined
in the IANA TZ database ([1844,2087]), and extending the validity of timezone
calculations from [2000,10000) to [0001,10000).

Migration: MIGRATING.md

Changelog

  • 2.3.0 (2023-06-27, TZDB version 2023c)
    • Create CustomZoneRegistry example
      to illustrate how to use a custom registry.
    • Update BasicZoneManager to detect gaps.
      • Allows AceTimeValidation/validation tests to pass.
      • Still not able to distinguish between exact and overlap though.
    • Allow multi-character ZoneRule.letter in BasicZoneProcessor.
      • Regenerate zonedb which enables 2 more zones: /Africa/Windhoek,
        and America/Belize
      • Increases zonedb by 150-200 bytes.
    • Rename BrokerFactory to ZoneInfoStore for better self-documentation.
      • This is an internal implementation detail. Downstream clients should
        not be affected.
    • ZoneContext
      • Move ZoneContext, letters[], fragments[] into PROGMEM.
      • Move zonedbXxx::kTzDatabaseVersion string into PROGMEM, and change
        type to const __FlashString*.
      • Create ZoneContextBroker around ZoneContext, for consistency
        with all other zoneinfo data structures. Merge ZoneContext.h into
        ZoneInfo.h.
      • Add startYearAccurate and untilYearAccurate to ZoneContext which
        define the interval of accurate transitions.
      • Saves around 150-200 bytes of RAM on AVR processors,
        200-350 bytes of RAM on ESP8266.
    • Cleanly separate zoneinfo storage classes from their brokers classes.
      • Three storage implementations instead of one: zoneinfolow,
        zoneinfomid, zoneinfohigh, supporting low, middle, and high time
        resolutions.
      • zoneinfohigh was created to support CompleteZoneProcessor,
        CompleteZoneManager and the zonedbc database.
      • zoneinfomid initially used in ExtendedZoneProcessor, but now
        unused.
      • Merge zoneinfo/ZonePolicy.h into zoneinfo/ZoneInfo.h.
      • Convert structs in zoneinfo/ZoneInfo.inc into templates, with
        synthetic typename S selector. Merge ZoneInfo.inc into
        ZoneInfo.h.
    • Support timezones before 1972 using CompleteZoneManager,
      CompleteZoneProcessor, and zonedbc database
      • Before standardizing on UTC around 1970, many timezones had local
        times offsets from UTC which require one-second resolution instead of
        one-minute resolution. This requires changing many internal variables
        from int16_t to int32_t.
      • Change TimeOffset to support one-second resolution using int32_t.
      • Rename BasicZone::stdOffseMinutes() to BasicZone::stdOffset()
        which returns a TimeOffset object.
      • Rename ExtendedZone::stdOffseMinutes() to
        ExtendedZone::stdOffset() which returns a TimeOffset object.
      • Leave BasicZoneProcessor using one-minute resolution because its
        algorithm has an inherent limitations which cannot handle many
        timezones before 1972, so no need to convert int16_t to int32_t
        fields.
      • Add CompleteZoneManager, CompleteZoneProcessor,
        CompleteZoneProcessorCache, CompleteZone
      • Add zonedbc database which is valid from [1800,10000), which
        includes all transitions in the TZDB since the first transition is
        1844.
      • Add scope=complete to access the zonedbc database.
    • Zone Processor with graceful degradation
      • Remove range checks against ZoneContext.startYear() and
        ZoneContext.untilYear()
      • Replace with LocalDate::kMinYear and LocalDate::kMaxYear, mostly
        for formatting reasons (prevent negative
        years, and years with more than 4 digits).
      • The zone processors will always return something reasonble across the
        entire int16_t range.
      • Only the accuracy suffers outside of the startYearAccurate() and
        untilYearAccurate() limits.
      • Along with v2.2 which always generates anchor rules for all zone
        policies, the startYearAccureate() and untilYearAccurate() allows
        for graceful degradation of classes like ZonedDateTime for years
        outside of this accuracy range.
    • Rename src/tzonedb* directories
      • to src/zonedb*testing for consistency with other acetime libraries

bxparks added 30 commits June 1, 2023 08:35
ZoneRegistrar is a higher level abtraction above the ZoneRegistry (array of
ZoneInfo* pointers) providing find/search functionality, so it belongs in
./ace_time/. The raw data (the registry) is stored in PROGMEM memory, and
accessed through the ZoneRegistryBroker, which belongs in ./zoneinfo/.
…6_t) minutes, left over from refactoring to (int32_t) seconds
* move basic::ZoneXxx, extended::ZoneXxx, complete::ZoneXxx to infos.h
* move basic::ZoneXxxBroker, extended::ZoneXxxBroker, complete::ZoneXxxBroker
  to brokers.h
* regenearte zonedb*, to be dependent only on `zoneinfo/infos.h`
* update src/ace_time so that they are mostly dependent only on
  `zoneinfo/brokers.h`
    * unfortunately, many classes and files still have dependencies to
      `zoneinfo/infos.h`
* rename `ZoneInfo.h` to `ZoneInfoMid.h`, in preparation for `ZoneInfoLow.h`
* rename `zoneinfo` namespace to `zoneinfomid` in preparation for `zoneinfolow`
* rename `ZoneInfoHires.h` to `ZoneInfoHigh.h` for readability
* rename `zoneinfohires` namepsace to `zoneinfohigh` for readability
* rename `BrokersHires.h` to `BrokersHigh.h` for readability
@bxparks bxparks merged commit 3e58e09 into master Jun 28, 2023
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant