Read the Markdown source ↗

Time Zone Availability Intersection

Find shared availability across explicit time windows and render it in participant time zones.

Version: 1.0.0. License: MIT. Status: tested reference baseline; no comparative ranking is claimed.

Contract

Require at least one uniquely identified participant. Windows use offset-aware timestamps and are half-open intervals. Merge overlapping or adjacent windows for each participant; intersect all participant calendars. Return UTC windows and per-participant local renderings using IANA zone names. Zero-duration intersections are omitted.

The exact required input fields and types are in input.schema.json. Extra fields are rejected at declared object boundaries. JSON duplicate keys and non-finite numbers are rejected by the CLI. Input strings are case-sensitive unless stated otherwise. Array order is preserved unless the contract specifies sorting.

Use

Unpack the ZIP, enter its directory, and run:

python3 baseline.py < example.input.json
python3 -m unittest -v

Python 3.10 or newer, standard library only. The reference implementation exposes run(input_dict) and accepts one JSON object on standard input. Success returns {"ok": true, "result": ...} with exit code 0. Invalid input returns {"ok": false, "error": "..."} with exit code 1. example.output.json contains the result without the CLI envelope. Import callers receive exceptions for invalid input.

Example input

{
  "participants": [
    {
      "id": "west",
      "zone": "America/Los_Angeles",
      "windows": [
        {
          "start": "2026-01-15T09:00:00-08:00",
          "end": "2026-01-15T11:00:00-08:00"
        }
      ]
    },
    {
      "id": "utc",
      "zone": "UTC",
      "windows": [
        {
          "start": "2026-01-15T18:00:00Z",
          "end": "2026-01-15T20:00:00Z"
        }
      ]
    }
  ]
}

Example result

{
  "windows": [
    {
      "start": "2026-01-15T18:00:00+00:00",
      "end": "2026-01-15T19:00:00+00:00",
      "local": {
        "west": {
          "start": "2026-01-15T10:00:00-08:00",
          "end": "2026-01-15T11:00:00-08:00"
        },
        "utc": {
          "start": "2026-01-15T18:00:00+00:00",
          "end": "2026-01-15T19:00:00+00:00"
        }
      }
    }
  ]
}

Boundaries

The host needs IANA time zone data for zoneinfo. Local ambiguous or nonexistent wall times must be resolved before input by supplying an explicit offset. The zone controls rendering only. No recurrence expansion, meeting duration, holiday policy, or booking is supplied.

This package performs no network calls, executes no submitted commands, and writes no user files. Host applications own authorization, resource budgets, and persistence. Example values are fixtures, not recommended policies or limits.

Acceptance and provenance

cases.json records named expected results and rejection cases. test_baseline.py runs those cases and checks the command-line contract. manifest.json records file digests. The specification, implementation, and evidence are separate files so a replacement implementation can target the same contract.

Original code and examples generated for this Arcomm collection. No third-party code is bundled. Read LICENSE for reuse terms.

References

Download

Download the file

SHA-256: dc1590db27fb9cb78b15889a0d87954bf55cf3b91e6c3414865ea622562b0542

Size: 7443 bytes.

Revisions

Revision history