Skip to content

Timed events show on their UTC day, not their local day, west of UTC #585

Open

Description

@armada877

What happens

The TUI calendar and the hey event commands put a timed event on its UTC date, not on its local date. In New York, an event that starts after 8 PM shows on the wrong day or does not show.

Steps to reproduce

  1. Set the machine zone and the HEY account zone to America/New_York.
  2. In HEY, add an event "Dinner" on Sunday 2026-10-25 from 9:30 PM to 11:00 PM.
  3. Run hey event day 2026-10-25.
  4. Run hey event day 2026-10-26.
  5. Open hey tui, go to Calendar, and open the day view for 2026-10-25 and 2026-10-26.

Expected

  • The dinner shows on Sunday 2026-10-25, at 9:30 PM.

Actual

  • hey event day 2026-10-25 does not show the dinner.
  • hey event day 2026-10-26 shows the dinner.
  • The TUI day view draws the dinner on Monday at 9:30 PM.
  • The TUI week view for the week of 2026-10-25 does not show the dinner.
  • hey event list and hey event week have the same problem.
  • hey event edit <id> 2026-10-25 does not find the event.

Cause

HEY reads a date in a JSON request as a UTC day. The TUI and the event commands send only a date. In New York, the UTC day 2026-10-26 starts at 8 PM on 2026-10-25. The CLI then groups each event on its local day, so an event from the next UTC day goes on a day that the CLI did not read.

Fix

PR #563 has a fix with tests. A day or week read also reads the one UTC day that the local days reach into. West of UTC, it reads the day after. East of UTC, it reads the day before. In UTC, it reads no extra day. Each edge of the local days uses its own offset, so a DST change and a half-hour zone are correct. It then keeps the timed events that overlap the local days. hey event list widens its window by the same rule, with no extra request.

The fix also:

  • starts a day at its first real instant, so a zone that skips or repeats midnight (for example America/Santiago or America/Havana) keeps each event on its own day, in the CLI and in the TUI day view.
  • sorts and prints the times of hey event day, hey event week and hey event list in the HEY account's zone, not the machine's zone. All-day events stay dates, and --json keeps UTC.

Environment

  • Found on main at 206753c (v1.8.1). main at eef0bd8 has no fix yet.
  • Linux, America/New_York

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions