Skip to content

Period monthOf() in HK time + clear stale Inspect tx list on month change

What / Why

Two defects in the Inspect-Period flow (owner report 2026-06-18).

DONE (origin/nightly, NOT main)

  1. monthOf() now uses Asia/Hong_Kong (c7f69cc9) β€” monthOf() was UTC-based while monthBounds() is HK-based, an asymmetry that mis-classified boundary txns: a tx whose UTC time is Aug-31 evening but whose HK wall-clock is Sep-1 was correctly EXCLUDED from August's Inspect list (HK bounds) but INCLUDED in August's period-close lock + auto-match gate (UTC monthOf). Result: closing August locked Sep-1-HK txns β€” "the period close moves to the first day of the next month." Fix: monthOf now projects via dayjs.tz to Asia/Hong_Kong, matching monthBounds/hkMonthBounds. All call sites inherit it (assertPeriodOpen.server, isMonthClosed, autoMatchHelpers, PeriodsTab incorpMonth/nowMonth, BankTransactionsTab getPeriodMonthKey).
  2. Clear stale tx list on month change (c7f69cc9) β€” the Inspect-Period modal flashed the PREVIOUS month's transactions when the user opened a different month; now cleared.
  3. Codex P2 (7adc15c6) β€” date-only strings (YYYY-MM-DD) are parsed through JS Date (UTC midnight per ECMA-262) before the .tz('Asia/Hong_Kong') projection, so a basis-period start of 2026-01-01 no longer re-displays as Dec 2025 in TZs ahead of HK (Tokyo/Sydney/ Auckland) β€” fixes the closed/total counters in AccountingOverview + date-only guard sites.

tsc clean on current nightly. (Merged #748.)

T-058 (fiscal-period UX / basis periods) Β· T-059 (AccountingOverview counters) Β· [[project_erl_incorporation]] (entityCalendar / HK basis periods)