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

Cookbook example for compiling time zone from tzdata rules #1370

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Commits on Feb 22, 2021

  1. Fix asserts in TimeZone transition tests

    equal() was forgotten here, leading to these tests always passing.
    ptomato committed Feb 22, 2021
    Configuration menu
    Copy the full SHA
    477046f View commit details
    Browse the repository at this point in the history
  2. Fix loops in TimeZone tests

    These tests called getNextTransition() and getPreviousTransition() four
    times on the same instant, instead of chaining four calls.
    ptomato committed Feb 22, 2021
    Configuration menu
    Copy the full SHA
    2c48cd3 View commit details
    Browse the repository at this point in the history
  3. TimeZone.getPreviousTransition() should never return its input

    getPreviousTransition() returns the last transition before the instant
    passed into it, not the last transition before or equal to. Otherwise,
    you would have to manually subtract a nanosecond in between each call if
    you wanted to get a series of previous transitions.
    
    Add similar tests for getNextTransition(), although that wasn't broken.
    
    No change needed to the spec text or documentation, which are already
    correct.
    ptomato committed Feb 22, 2021
    Configuration menu
    Copy the full SHA
    022f6f0 View commit details
    Browse the repository at this point in the history
  4. cookbook: Add "Time zone from tzdata rules" example

    An example of parsing the rules from the tzdata (sometimes called "Olson
    database") directly, and creating a Temporal.TimeZone object out of them.
    
    Closes: #605
    ptomato committed Feb 22, 2021
    Configuration menu
    Copy the full SHA
    4fc9cf5 View commit details
    Browse the repository at this point in the history