Skip to content

Idea: auto-detect timezone from Team Meeting Calendar instead of manual TZ #18

Description

@rachmo

Idea, not yet spec'd

Came up during grilling on the /hawk/hawkbot slash-command rename (CONTEXT.md, ADR-0006) — logging it as a note to revisit later, not ready for implementation.

Current state: the operator manually sets the TZ environment variable in .env to the team's real IANA timezone. src/domain/calendar.ts relies on this ambient process timezone for all wall-clock math (midnight, "the day before," all-day date boundaries).

Idea: since Hawk Bot already has read access to the Team Meeting Calendar via the Google service account, it could read that calendar's own timeZone field (via calendars.get) instead of requiring the operator to hand-set TZ — one less manual deployment step.

Why it's not simplecalendar.ts currently depends on Date's local-time methods against the ambient process TZ, not an explicit timezone parameter. Auto-detecting from the calendar would mean either:

  • mutating process.env.TZ at boot from the fetched value (simple, but an odd runtime side effect, and wouldn't pick up a mid-life timezone change without a restart), or
  • refactoring the wall-clock math in calendar.ts (and weeklySummary.ts, which has similar formatting logic) to take timezone explicitly via a timezone-aware date library

Either way it also needs a fallback for when the Calendar API call fails or the calendar has no timeZone set.

Not scoped or prioritized — just don't want to lose the idea.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions